1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00

coverity 83686 server close sockfd if failing out

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2014-11-30 13:30:57 +08:00
parent a3439032db
commit 9c8d590f9d

View file

@ -58,8 +58,10 @@ int lws_context_init_server(struct lws_context_creation_info *info,
* allow us to restart even if old sockets in TIME_WAIT
*/
if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR,
(const void *)&opt, sizeof(opt)) < 0)
(const void *)&opt, sizeof(opt)) < 0) {
compatible_close(sockfd);
return 1;
}
lws_plat_set_socket_options(context, sockfd);