mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-18 01:34:31 +08:00
Free path string first when it is no longer needed
This commit is contained in:
parent
4844b0c1d3
commit
f5dcb96ae5
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user