summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-04-20 12:15:20 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-04-20 12:15:20 +0000
commitf5dcb96ae5e257efc4dc9cdd510119e9788d1228 (patch)
treeecc6395f031b09b64d179dfc5e98a350ffc488ce /audio
parent4844b0c1d3a2f648b1c0957a3ef2551407be79b9 (diff)
Free path string first when it is no longer needed
Diffstat (limited to 'audio')
-rw-r--r--audio/manager.c3
1 files changed, 2 insertions, 1 deletions
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);
}