summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-09-30 05:01:32 +0200
committerMarcel Holtmann <marcel@holtmann.org>2008-09-30 05:01:32 +0200
commit9009725785ef6e8a7600c5796bdfeedc1586a845 (patch)
tree8612a2a39d09bfe02c15c64f5c403edca3722da6 /plugins
parentdbe884207a4033ba6269032b55879339aaa5c6c0 (diff)
downloadbluez-9009725785ef6e8a7600c5796bdfeedc1586a845.tar.gz
Fix memory leaks with HAL messages
Diffstat (limited to 'plugins')
-rw-r--r--plugins/hal.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/hal.c b/plugins/hal.c
index 1adab4d8d..84b530eed 100644
--- a/plugins/hal.c
+++ b/plugins/hal.c
@@ -50,6 +50,7 @@ static void formfactor_reply(DBusPendingCall *call, void *user_data)
if (dbus_message_get_args(reply, NULL, DBUS_TYPE_STRING, &formfactor,
DBUS_TYPE_INVALID) == FALSE) {
error("Wrong formfactor arguments");
+ dbus_message_unref(reply);
return;
}
@@ -66,6 +67,8 @@ static void formfactor_reply(DBusPendingCall *call, void *user_data)
minor += 1 << 4;
}
+ dbus_message_unref(reply);
+
dd = hci_open_dev(adapter_get_dev_id(adapter));
if (dd < 0)
return;
@@ -114,12 +117,15 @@ static int hal_probe(struct btd_adapter *adapter)
if (dbus_connection_send_with_reply(connection, message,
&call, -1) == FALSE) {
error("Failed to send formfactor request");
+ dbus_message_unref(message);
dbus_connection_unref(connection);
return -EIO;
}
dbus_pending_call_set_notify(call, formfactor_reply, adapter, NULL);
+ dbus_message_unref(message);
+
return 0;
}