mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-24 20:21:49 +00:00
Not leaking socket in set ports option
This commit is contained in:
1 parent
c0eb3e56b4
commit
ab16220861
1 file changed
+1
@@ -4576,6 +4576,7 @@ static int set_ports_option(struct mg_context *ctx) {
|
|||||||
} else if ((ptr = realloc(ctx->listening_sockets,
|
} else if ((ptr = realloc(ctx->listening_sockets,
|
||||||
(ctx->num_listening_sockets + 1) *
|
(ctx->num_listening_sockets + 1) *
|
||||||
sizeof(ctx->listening_sockets[0]))) == NULL) {
|
sizeof(ctx->listening_sockets[0]))) == NULL) {
|
||||||
|
closesocket(so.sock);
|
||||||
success = 0;
|
success = 0;
|
||||||
} else {
|
} else {
|
||||||
set_close_on_exec(so.sock);
|
set_close_on_exec(so.sock);
|
||||||
|
|||||||
Reference in new issue
Block a user