Browse Source

Terminate master_thread early when there are no listening sockets to prevent CivetWeb from crashing

Signed-off-by: DL6ER <dl6er@dl6er.de>
DL6ER 4 months ago
parent
commit
f4d9bf25f1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/civetweb.c

+ 1 - 1
src/civetweb.c

@@ -20542,7 +20542,7 @@ master_thread_run(struct mg_context *ctx)
 	unsigned int i;
 	unsigned int workerthreadcount;
 
-	if (!ctx) {
+	if (!ctx || !ctx->listening_socket_fds) {
 		return;
 	}