summaryrefslogtreecommitdiffstats
path: root/server/monitor.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-12-09 16:15:18 -0500
committerSimo Sorce <idra@samba.org>2008-12-09 16:48:45 -0500
commitdd42f1e418addaedbeeff9602520288edf3c7108 (patch)
tree2f176cc7ba2dc26e93fd844b9c0e40484a2ed0d8 /server/monitor.c
parent8f86577722f9e880c82e7a98fcb14ee06acb7170 (diff)
downloadsssd-dd42f1e418addaedbeeff9602520288edf3c7108.tar.gz
sssd-dd42f1e418addaedbeeff9602520288edf3c7108.tar.xz
sssd-dd42f1e418addaedbeeff9602520288edf3c7108.zip
Fix dbus related memory leaks
Diffstat (limited to 'server/monitor.c')
-rw-r--r--server/monitor.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/server/monitor.c b/server/monitor.c
index 0075aac74..38510f17c 100644
--- a/server/monitor.c
+++ b/server/monitor.c
@@ -508,6 +508,7 @@ static int dbus_service_init(struct sbus_conn_ctx *conn_ctx, void *data)
* We'll drop it using the default destructor.
*/
DEBUG(0, ("D-BUS send failed.\n"));
+ dbus_message_unref(msg);
talloc_free(conn_ctx);
return EIO;
}
@@ -545,7 +546,7 @@ static void identity_check(DBusPendingCall *pending, void *data)
/* Destroy this connection */
sbus_disconnect(conn_ctx);
- return;
+ goto done;
}
type = dbus_message_get_type(reply);
@@ -558,7 +559,7 @@ static void identity_check(DBusPendingCall *pending, void *data)
if (!ret) {
DEBUG(1,("Failed, to parse message, killing connection\n"));
sbus_disconnect(conn_ctx);
- return;
+ goto done;
}
/* search this service in the list */
@@ -573,7 +574,7 @@ static void identity_check(DBusPendingCall *pending, void *data)
if (!svc) {
DEBUG(0,("Unable to find peer in list of services, killing connection!\n"));
sbus_disconnect(conn_ctx);
- return;
+ goto done;
}
/* transfer all from the fake service and get rid of it */
@@ -599,6 +600,10 @@ static void identity_check(DBusPendingCall *pending, void *data)
sbus_disconnect(conn_ctx);
return;
}
+
+done:
+ dbus_pending_call_unref(pending);
+ dbus_message_unref(reply);
}
/* service_send_ping
@@ -681,7 +686,7 @@ static void ping_check(DBusPendingCall *pending, void *data)
/* Destroy this connection */
sbus_disconnect(conn_ctx);
- return;
+ goto done;
}
type = dbus_message_get_type(reply);
@@ -713,8 +718,11 @@ static void ping_check(DBusPendingCall *pending, void *data)
* We'll destroy it now.
*/
sbus_disconnect(conn_ctx);
- return;
}
+
+done:
+ dbus_pending_call_unref(pending);
+ dbus_message_unref(reply);
}
/* service_check_alive