Explorar el Código

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

Kimmo Mustonen hace 8 años
padre
commit
b27f0250e7
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  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),
 			mg_cry(fc(ctx),
 			       "cannot bind: address family not supported (entry %i)",
 			       "cannot bind: address family not supported (entry %i)",
 			       portsTotal);
 			       portsTotal);
+			closesocket(so.sock);
+			so.sock = INVALID_SOCKET;
 			continue;
 			continue;
 		}
 		}