Browse Source

Fix a resource leak about so.sock reported by Coverity.

Kimmo Mustonen 8 years ago
parent
commit
b27f0250e7
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/civetweb.c

+ 2 - 0
src/civetweb.c

@@ -12192,6 +12192,8 @@ set_ports_option(struct mg_context *ctx)
 			mg_cry(fc(ctx),
 			       "cannot bind: address family not supported (entry %i)",
 			       portsTotal);
+			closesocket(so.sock);
+			so.sock = INVALID_SOCKET;
 			continue;
 		}