edbus: Fix invalid access memory in edbus_service_interface_unregister()

_object_unregister is called synchronized by libdbus, so when _interface_free() ran
your object its already freed.

==30579== Invalid read of size 4
==30579==    at 0x4775190: _find_object_manager_parent (edbus_service.c:803)
==30579==    by 0x4775292: _interface_free (edbus_service.c:1011)
==30579==    by 0x4777F1D: edbus_service_interface_unregister (edbus_service.c:1101)
==30579==    by 0x40CBD28: elm_dbus_menu_delete (elm_dbus_menu.c:128)
==30579==    by 0x414552F: _elm_menu_smart_del (elm_menu.c:562)
==30579==    by 0x4810F39: _eo_op_internal (eo.c:363)
==30579==    by 0x4812E1B: eo_do_internal (eo.c:403)
==30579==    by 0x4279D02: evas_object_smart_del (evas_object_smart.c:1080)

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 81180
This commit is contained in:
José Roberto de Souza 2012-12-17 19:48:54 +00:00 committed by Lucas De Marchi
parent 165eb12d81
commit 36e5dd2ebc
1 changed files with 7 additions and 2 deletions

View File

@ -1095,9 +1095,14 @@ EAPI void
edbus_service_interface_unregister(EDBus_Service_Interface *iface)
{
EDBUS_SERVICE_INTERFACE_CHECK(iface);
if (!eina_hash_find(iface->obj->interfaces, objmanager->name))
{
//properties + introspectable + iface that user wants unregister
if (eina_hash_population(iface->obj->interfaces) < 4)
edbus_service_object_unregister(iface);
return;
}
eina_hash_del(iface->obj->interfaces, NULL, iface);
if (eina_hash_population(iface->obj->interfaces) < 3)
edbus_service_object_unregister(iface);
_interface_free(iface);
}