ecore-wl2: fix use after free and leak when deleting display object
authorMike Blumenkrantz <zmike@osg.samsung.com>
Sat, 5 Dec 2015 18:06:03 +0000 (13:06 -0500)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Sat, 5 Dec 2015 18:06:03 +0000 (13:06 -0500)
ref T2919

src/lib/ecore_wl2/ecore_wl2_display.c

index 4f612b1..289485b 100644 (file)
@@ -359,10 +359,11 @@ _ecore_wl2_display_cleanup(Ecore_Wl2_Display *ewd)
 
    wl_display_flush(ewd->wl.display);
 
-   if (ewd->name) free(ewd->name);
-
    /* remove this client display from hash */
-   if (_client_displays) eina_hash_del(_client_displays, ewd->name, ewd);
+   eina_hash_del_by_key(_client_displays, ewd->name);
+
+   free(ewd->name);
+   free(ewd);
 }
 
 Ecore_Wl2_Window *