From 68bd0b61b56c5bbf8c2687c3d46edc35f64679af Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 22 Nov 2013 17:34:20 +0100 Subject: reqs: fix CID 1130969 - unchecked return code from library Effectively, the return code of fcntl was not checked by not checking the return code of socket_nonblocking() for the server fd. Found by coverity. Signed-off-by: Michael Adam --- src/reqs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/reqs.c b/src/reqs.c index 00e20aa..37f87d5 100644 --- a/src/reqs.c +++ b/src/reqs.c @@ -1126,7 +1126,12 @@ static void relay_connection (struct conn_s *connptr) return; } - socket_nonblocking (connptr->server_fd); + ret = socket_nonblocking (connptr->server_fd); + if (ret != 0) { + log_message(LOG_ERR, "Failed to set the server socket " + "to non-blocking: %s", strerror(errno)); + return; + } last_access = time (NULL); -- cgit v1.2.3