From e6dbaa236a78598c2a423f653ae9d8c93c4e6040 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 29 Jan 2016 15:40:08 +0800 Subject: [PATCH] coverity 157402 explicitly disallow handling invalid sockfd Signed-off-by: Andy Green --- lib/ssl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ssl.c b/lib/ssl.c index 364ab29b..751f9c19 100644 --- a/lib/ssl.c +++ b/lib/ssl.c @@ -612,7 +612,8 @@ lws_server_socket_service_ssl(struct lws *wsi, lws_sockfd_type accept_fd) lwsl_err("SSL_new failed: %s\n", ERR_error_string(SSL_get_error(wsi->ssl, 0), NULL)); lws_decode_ssl_error(); - compatible_close(accept_fd); + if (accept_fd != LWS_SOCK_INVALID) + compatible_close(accept_fd); goto fail; }