From f5dcb96ae5e257efc4dc9cdd510119e9788d1228 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 20 Apr 2007 12:15:20 +0000 Subject: Free path string first when it is no longer needed --- audio/manager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/audio/manager.c b/audio/manager.c index 87dd4b01..1512218f 100644 --- a/audio/manager.c +++ b/audio/manager.c @@ -229,7 +229,6 @@ static DBusHandlerResult am_remove_headset(DBusMessage *msg) path = match->data; headsets = g_slist_remove(headsets, path); - g_free(path); if (default_hs == path) { if (!headsets) @@ -245,6 +244,8 @@ static DBusHandlerResult am_remove_headset(DBusMessage *msg) headset_remove(path); + g_free(path); + return send_message_and_unref(connection, reply); } -- cgit