Jelajahi Sumber

daemon.c: fixed heap manipulations with mutex held

Evgeny Grin (Karlson2k) 2 tahun lalu
induk
melakukan
944e380b39
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      src/microhttpd/daemon.c

+ 3 - 2
src/microhttpd/daemon.c

@@ -483,10 +483,11 @@ MHD_ip_limit_del (struct MHD_Daemon *daemon,
     tdelete (found_key,
              &daemon->per_ip_connection_count,
              &MHD_ip_addr_compare);
+    MHD_ip_count_unlock (daemon);
     free (found_key);
   }
-
-  MHD_ip_count_unlock (daemon);
+  else
+    MHD_ip_count_unlock (daemon);
 }