summaryrefslogtreecommitdiff
path: root/lib/async_req
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2015-06-16 06:20:56 +0000
committerVolker Lendecke <vl@samba.org>2015-06-16 19:22:52 +0200
commitcf598156dd947b839a6ccb6d88868c5080ec5907 (patch)
tree162970e25e513f2e6a9ac19dee4e3cb17672639b /lib/async_req
parent90eefb1779131c25b588043457fc3c4f4e0521f4 (diff)
downloadsamba-cf598156dd947b839a6ccb6d88868c5080ec5907.tar.gz
lib: Fix CID 1306765 Unchecked return value from library
This one might be a bit controversial. I don't see from man fcntl how this could fail. But if it does, we definitely do want to know about it. And here we don't have any good way to tell our caller, so abort. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Jun 16 19:22:52 CEST 2015 on sn-devel-104
Diffstat (limited to 'lib/async_req')
-rw-r--r--lib/async_req/async_sock.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c
index 89272ee5002..e90f4e6e26a 100644
--- a/lib/async_req/async_sock.c
+++ b/lib/async_req/async_sock.c
@@ -156,7 +156,13 @@ static void async_connect_cleanup(struct tevent_req *req,
TALLOC_FREE(state->fde);
if (state->fd != -1) {
- fcntl(state->fd, F_SETFL, state->old_sockflags);
+ int ret;
+
+ ret = fcntl(state->fd, F_SETFL, state->old_sockflags);
+ if (ret == -1) {
+ abort();
+ }
+
state->fd = -1;
}
}