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:
parent
a3439032db
commit
9c8d590f9d
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue