소스 검색

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

Kimmo Mustonen 8 년 전
부모
커밋
b27f0250e7
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  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;
 		}