diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-12-31 20:07:41 -0800 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-12-31 20:07:41 -0800 |
commit | fb2a03c1b128e6c79103ebc098fa394b7c2bf4c3 (patch) | |
tree | 543b30abb89b73dba4eef57017d25e34af2f62b6 /plugins/bluetooth.c | |
parent | 3150ca3c9379ebf811d26dace9153f19a0569080 (diff) | |
download | connman-fb2a03c1b128e6c79103ebc098fa394b7c2bf4c3.tar.gz connman-fb2a03c1b128e6c79103ebc098fa394b7c2bf4c3.tar.bz2 connman-fb2a03c1b128e6c79103ebc098fa394b7c2bf4c3.zip |
Fix memory leaks caused by missing dbus_pending_call_unref()
Diffstat (limited to 'plugins/bluetooth.c')
-rw-r--r-- | plugins/bluetooth.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c index da150f2e..0f0abb7c 100644 --- a/plugins/bluetooth.c +++ b/plugins/bluetooth.c @@ -86,8 +86,6 @@ static void connect_reply(DBusPendingCall *call, void *user_data) DBG("network %p", network); reply = dbus_pending_call_steal_reply(call); - if (reply == NULL) - return; dbus_error_init(&error); @@ -117,6 +115,8 @@ static void connect_reply(DBusPendingCall *call, void *user_data) done: dbus_message_unref(reply); + + dbus_pending_call_unref(call); } static int pan_connect(struct connman_network *network) @@ -173,8 +173,6 @@ static void disconnect_reply(DBusPendingCall *call, void *user_data) DBG("network %p", network); reply = dbus_pending_call_steal_reply(call); - if (reply == NULL) - return; dbus_error_init(&error); @@ -192,6 +190,8 @@ static void disconnect_reply(DBusPendingCall *call, void *user_data) done: dbus_message_unref(reply); + + dbus_pending_call_unref(call); } static int pan_disconnect(struct connman_network *network) @@ -267,6 +267,8 @@ static void powered_reply(DBusPendingCall *call, void *user_data) reply = dbus_pending_call_steal_reply(call); dbus_message_unref(reply); + + dbus_pending_call_unref(call); } static int change_powered(DBusConnection *connection, const char *path, @@ -433,8 +435,6 @@ static void network_properties_reply(DBusPendingCall *call, void *user_data) char ident[13]; reply = dbus_pending_call_steal_reply(call); - if (reply == NULL) - return; extract_properties(reply, &parent, &address, NULL, &name, NULL, NULL, &uuids, NULL); @@ -483,6 +483,8 @@ static void network_properties_reply(DBusPendingCall *call, void *user_data) done: dbus_message_unref(reply); + + dbus_pending_call_unref(call); } static void add_network(struct connman_device *device, const char *path) @@ -591,8 +593,6 @@ static void adapter_properties_reply(DBusPendingCall *call, void *user_data) DBG("path %s", path); reply = dbus_pending_call_steal_reply(call); - if (reply == NULL) - return; if (path == NULL) goto done; @@ -645,6 +645,8 @@ update: done: dbus_message_unref(reply); + + dbus_pending_call_unref(call); } static void add_adapter(DBusConnection *connection, const char *path) @@ -718,8 +720,6 @@ static void list_adapters_reply(DBusPendingCall *call, void *user_data) DBG(""); reply = dbus_pending_call_steal_reply(call); - if (reply == NULL) - return; dbus_error_init(&error); @@ -742,6 +742,8 @@ static void list_adapters_reply(DBusPendingCall *call, void *user_data) done: dbus_message_unref(reply); + + dbus_pending_call_unref(call); } static void unregister_device(gpointer data) |