coverity 169271 - take care about sockfd of -1 on close

This commit is contained in:
Andy Green 2016-08-28 09:21:56 +08:00
parent 2f863cf59a
commit d8e051dd97

View file

@ -432,7 +432,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);
#if defined(LWS_WITH_ESP8266)
espconn_disconnect(wsi->sock);