summaryrefslogtreecommitdiff
path: root/lib/async_req
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2015-06-23 10:18:31 +0200
committerJeremy Allison <jra@samba.org>2015-06-23 22:12:08 +0200
commitddd61126fb35d70e20b2d5007350e4327f470507 (patch)
tree0758db8ac218ef89d1e23dce6a6907bfe7a558c4 /lib/async_req
parent1f99ba7749a766f733f381db2925076290836be2 (diff)
downloadsamba-ddd61126fb35d70e20b2d5007350e4327f470507.tar.gz
lib: Fix CID 710685 Unchecked return value from library
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/async_req')
-rw-r--r--lib/async_req/async_sock.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c
index e90f4e6e26a..d2cda1572db 100644
--- a/lib/async_req/async_sock.c
+++ b/lib/async_req/async_sock.c
@@ -74,6 +74,7 @@ struct tevent_req *async_connect_send(
{
struct tevent_req *req;
struct async_connect_state *state;
+ int ret;
req = tevent_req_create(mem_ctx, &state, struct async_connect_state);
if (req == NULL) {
@@ -105,7 +106,11 @@ struct tevent_req *async_connect_send(
}
memcpy(&state->address, address, address_len);
- set_blocking(fd, false);
+ ret = set_blocking(fd, false);
+ if (ret == -1) {
+ tevent_req_error(req, errno);
+ return tevent_req_post(req, ev);
+ }
if (state->before_connect != NULL) {
state->before_connect(state->private_data);