Explorar o código

Free mutex prior to freeing conn

The worker_thread_run will handle freeing the mutex in a server context
Jacob Skillin %!s(int64=9) %!d(string=hai) anos
pai
achega
c793d57105
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/civetweb.c

+ 1 - 1
src/civetweb.c

@@ -10971,9 +10971,9 @@ mg_close_connection(struct mg_connection *conn)
 		}
 		mg_free(client_ctx->workerthreadids);
 		mg_free(client_ctx);
+		(void)pthread_mutex_destroy(&conn->mutex);
 		mg_free(conn);
 	}
-	(void)pthread_mutex_destroy(&conn->mutex);
 }