From d1eccb487ac72afd7c8e898ed3c0a52106321e0a Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Fri, 26 Dec 2014 13:40:42 +0100 Subject: [PATCH] session.c: check return value of session_nonblock in debug mode Reported by Coverity CID 89805. --- src/session.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/session.c b/src/session.c index 6549e7a..dc9dcd4 100644 --- a/src/session.c +++ b/src/session.c @@ -1040,9 +1040,14 @@ session_free(LIBSSH2_SESSION *session) _libssh2_debug(session, LIBSSH2_TRACE_TRANS, "Extra packets left %d", packets_left); - if(session->socket_prev_blockstate) + if(session->socket_prev_blockstate) { /* if the socket was previously blocking, put it back so */ - session_nonblock(session->socket_fd, 0); + rc = session_nonblock(session->socket_fd, 0); + if (rc) { + _libssh2_debug(session, LIBSSH2_TRACE_TRANS, + "unable to reset socket's blocking state"); + } + } if (session->server_hostkey) { LIBSSH2_FREE(session, session->server_hostkey);