summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-rfcomm.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-09-21 15:59:25 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-09-21 15:59:25 +0000
commitd9ebfa690ef6258b40d784ed213a0ee1e55a4fea (patch)
tree1eeacf352203bbe3ba019f23aae263f5e9af7c81 /hcid/dbus-rfcomm.c
parentc01205fa5a60824b7bf6a945d1dbc4a7656f2005 (diff)
Fix memory leak in Bind and Connect methods
Diffstat (limited to 'hcid/dbus-rfcomm.c')
-rw-r--r--hcid/dbus-rfcomm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hcid/dbus-rfcomm.c b/hcid/dbus-rfcomm.c
index 558d2c5d..64b0580d 100644
--- a/hcid/dbus-rfcomm.c
+++ b/hcid/dbus-rfcomm.c
@@ -727,14 +727,14 @@ static DBusHandlerResult rfcomm_connect_req(DBusConnection *conn,
return error_invalid_arguments(conn, msg);
}
- if (!err)
- return DBUS_HANDLER_RESULT_HANDLED;
-
if (uuid)
free(uuid);
if (handle)
free(handle);
+ if (!err)
+ return DBUS_HANDLER_RESULT_HANDLED;
+
rfcomm_continue_data_free(cdata);
return error_failed(conn, msg, err);
@@ -952,14 +952,14 @@ static DBusHandlerResult rfcomm_bind_req(DBusConnection *conn,
return error_invalid_arguments(conn, msg);
}
- if (!err)
- return DBUS_HANDLER_RESULT_HANDLED;
-
if (uuid)
free(uuid);
if (handle)
free(handle);
+ if (!err)
+ return DBUS_HANDLER_RESULT_HANDLED;
+
rfcomm_continue_data_free(cdata);
return error_failed(conn, msg, err);