lib: Fix CID 710685 Unchecked return value from library
authorVolker Lendecke <vl@samba.org>
Tue, 23 Jun 2015 08:18:31 +0000 (10:18 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 23 Jun 2015 20:12:08 +0000 (22:12 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/async_req/async_sock.c

index e90f4e6e26a3a7228fe3f7047399b9d467f6d97a..d2cda1572db64bd2cd7bf01f419104625dde68e3 100644 (file)
@@ -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);