Plug some memory leaks and an invalid read

Note in protocol-dbus.c specifically, method_signatures needs to be freed
before method_handlers, because otherwise h->method_name is freed while it is
still in use as a key in the method_signatures hashmap.
This commit is contained in:
Maarten Bosmans 2011-08-12 00:17:39 +02:00 committed by Colin Guthrie
parent a8f20e8d95
commit b430407f47
5 changed files with 6 additions and 3 deletions

View file

@ -839,8 +839,8 @@ int pa_dbus_protocol_remove_interface(pa_dbus_protocol *p, const char* path, con
pa_log_debug("Interface %s removed from object %s", iface_entry->name, obj_entry->path);
pa_xfree(iface_entry->name);
pa_hashmap_free(iface_entry->method_handlers, method_handler_free_cb, NULL);
pa_hashmap_free(iface_entry->method_signatures, method_signature_free_cb, NULL);
pa_hashmap_free(iface_entry->method_handlers, method_handler_free_cb, NULL);
pa_hashmap_free(iface_entry->property_handlers, property_handler_free_cb, NULL);
for (i = 0; i < iface_entry->n_signals; ++i) {