From: Andy Green Date: Sun, 28 Aug 2016 01:54:30 +0000 (+0800) Subject: coverity 169271 - take care about sockfd of -1 on close X-Git-Tag: upstream/2.0.3~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f7e4dbd48cdba414b91b2632e6053221ca8ba9f;p=platform%2Fupstream%2Flibwebsockets.git coverity 169271 - take care about sockfd of -1 on close --- diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index c475d6a9..f62c1561 100755 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -420,7 +420,8 @@ just_kill_connection: lws_remove_from_timeout_list(wsi); /* checking return redundant since we anyway close */ - remove_wsi_socket_from_fds(wsi); + if (wsi->sock != LWS_SOCK_INVALID) + remove_wsi_socket_from_fds(wsi); wsi->state = LWSS_DEAD_SOCKET;