Commit ab162208 authored by Sergey Lyubka's avatar Sergey Lyubka

Not leaking socket in set ports option

parent c0eb3e56
...@@ -4576,6 +4576,7 @@ static int set_ports_option(struct mg_context *ctx) { ...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment