diff options
author | Cidorvan Leite <cidorvan.leite@openbossa.org> | 2008-04-25 17:53:58 +0000 |
---|---|---|
committer | Cidorvan Leite <cidorvan.leite@openbossa.org> | 2008-04-25 17:53:58 +0000 |
commit | 6c752ad5657d86f3ef900232e4ee8cfc115863a3 (patch) | |
tree | 4c32d79d5c0de6506e56fb1d4eb82ef742b291dc /audio | |
parent | fa7d18bdf518a3ea6cb379a1b765547c58155166 (diff) |
Fixed memory leak in headset stop function
Diffstat (limited to 'audio')
-rw-r--r-- | audio/headset.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/audio/headset.c b/audio/headset.c index 83752cdf..b2948da2 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -1190,13 +1190,13 @@ static DBusHandlerResult hs_stop(DBusConnection *conn, DBusMessage *msg, struct headset *hs = device->headset; DBusMessage *reply = NULL; + if (hs->state < HEADSET_STATE_PLAY_IN_PROGRESS) + return error_not_connected(conn, msg); + reply = dbus_message_new_method_return(msg); if (!reply) return DBUS_HANDLER_RESULT_NEED_MEMORY; - if (hs->state < HEADSET_STATE_PLAY_IN_PROGRESS) - return error_not_connected(conn, msg); - headset_set_state(device, HEADSET_STATE_CONNECTED); send_message_and_unref(conn, reply); |