diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2007-01-20 21:25:35 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2007-01-20 21:25:35 +0000 |
commit | 73e0b1b5e832010192ec6d57e2afa36de2c96299 (patch) | |
tree | d905059ad500a1097f62d0a87978c4c15b0e67eb /hcid | |
parent | 852a332dbcd42a929bd98de248fdce3cc6edc077 (diff) |
Fix memory leaks in record handling
Diffstat (limited to 'hcid')
-rw-r--r-- | hcid/dbus-database.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/hcid/dbus-database.c b/hcid/dbus-database.c index ea275b7a..d2268878 100644 --- a/hcid/dbus-database.c +++ b/hcid/dbus-database.c @@ -78,6 +78,9 @@ static void exit_callback(const char *name, void *user_data) else unregister_sdp_record(user_record->handle); + if (user_record->sender) + free(user_record->sender); + free(user_record); } @@ -174,6 +177,7 @@ static DBusHandlerResult add_service_record_from_xml(DBusConnection *conn, sdp_record_free(sdp_record); return error_failed(conn, msg, EIO); } + sdp_record_free(sdp_record); } sender = dbus_message_get_sender(msg); @@ -215,11 +219,16 @@ static DBusHandlerResult remove_service_record(DBusConnection *conn, name_listener_remove(conn, sender, exit_callback, user_record); + records = g_slist_remove(records, user_record); + if (sdp_server_enable) remove_record_from_server(handle); else unregister_sdp_record(handle); + if (user_record->sender) + free(user_record->sender); + free(user_record); reply = dbus_message_new_method_return(msg); |