瀏覽代碼

Fix handle leak in HTTP(S) client

Fix to #719 from nemethz5
bel2125 5 年之前
父節點
當前提交
76790038d8
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/civetweb.c

+ 2 - 0
src/civetweb.c

@@ -17068,10 +17068,12 @@ mg_close_connection(struct mg_connection *conn)
 		(void)pthread_mutex_destroy(&conn->mutex);
 		mg_free(conn);
 	} else if (conn->phys_ctx->context_type == CONTEXT_HTTP_CLIENT) {
+		(void)pthread_mutex_destroy(&conn->mutex);
 		mg_free(conn);
 	}
 #else
 	if (conn->phys_ctx->context_type == CONTEXT_HTTP_CLIENT) { /* Client */
+		(void)pthread_mutex_destroy(&conn->mutex);
 		mg_free(conn);
 	}
 #endif /* defined(USE_WEBSOCKET) */