evas/cserve2: (shutdown) fix double free issue
authorJean-Philippe Andre <jp.andre@samsung.com>
Fri, 14 Jun 2013 05:38:21 +0000 (14:38 +0900)
committerCedric Bail <cedric.bail@samsung.com>
Fri, 14 Jun 2013 07:38:18 +0000 (16:38 +0900)
glibc double free happens when shutting down cserve, while
requests are being processed. this is because the entry is
being deleted from the hash but the cancel request fails
(so it should be deleted again from the hash)

Another patch going to fix the double free.

src/bin/evas/evas_cserve2_cache.c

index fb76c55..ed8f70c 100644 (file)
@@ -403,7 +403,11 @@ _request_failed(Entry *e, Error_Type type EINA_UNUSED)
         else
           continue;
 
-        eina_hash_del_by_key(hash, &(ref->client_entry_id));
+        if (type != CSERVE2_REQUEST_CANCEL)
+          {
+             DBG("removing entry %u from hash", ref->client_entry_id);
+             eina_hash_del_by_key(hash, &(ref->client_entry_id));
+          }
      }
 }