Parcourir la source

Fix a possible socket leak

xtne6f il y a 5 ans
Parent
commit
0e8cdd7d6a
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      src/civetweb.c

+ 2 - 0
src/civetweb.c

@@ -15295,6 +15295,8 @@ set_ports_option(struct mg_context *phys_ctx)
 			                    "%s value \"%s\" is invalid",
 			                    config_options[LISTEN_BACKLOG_SIZE].name,
 			                    opt_txt);
+			closesocket(so.sock);
+			so.sock = INVALID_SOCKET;
 			continue;
 		}