diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2010-03-17 14:53:17 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-03-17 16:41:01 -0400 |
commit | f1bc4e8b9daf04a5cb4b9464021bb9e816eed3ea (patch) | |
tree | e567f20493ad395a5f5b251f1f69cac6410a7789 /src/monitor | |
parent | 1d065874a1aa1db06994a16dae1a78555fabf776 (diff) | |
download | sssd-f1bc4e8b9daf04a5cb4b9464021bb9e816eed3ea.tar.gz sssd-f1bc4e8b9daf04a5cb4b9464021bb9e816eed3ea.tar.bz2 sssd-f1bc4e8b9daf04a5cb4b9464021bb9e816eed3ea.zip |
Fix a series of memory leaks in the SBUS
Diffstat (limited to 'src/monitor')
-rw-r--r-- | src/monitor/monitor.c | 19 | ||||
-rw-r--r-- | src/monitor/monitor_sbus.c | 9 |
2 files changed, 19 insertions, 9 deletions
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 5a86e553..0ba33546 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -687,6 +687,7 @@ static int monitor_update_resolv(struct config_file_ctx *file_ctx, static int service_signal(struct mt_svc *svc, const char *svc_signal) { DBusMessage *msg; + int ret; if (svc->provider && strcasecmp(svc->provider, "local") == 0) { /* The local provider requires no signaling */ @@ -713,9 +714,12 @@ static int service_signal(struct mt_svc *svc, const char *svc_signal) return ENOMEM; } - return sbus_conn_send(svc->conn, msg, - svc->mt_ctx->service_id_timeout, - reload_reply, svc, NULL); + ret = sbus_conn_send(svc->conn, msg, + svc->mt_ctx->service_id_timeout, + reload_reply, svc, NULL); + + dbus_message_unref(msg); + return ret; } static int service_signal_dns_reload(struct mt_svc *svc) @@ -1843,6 +1847,7 @@ static int monitor_service_init(struct sbus_connection *conn, void *data) static int service_send_ping(struct mt_svc *svc) { DBusMessage *msg; + int ret; if (!svc->conn) { DEBUG(8, ("Service not yet initialized\n")); @@ -1866,9 +1871,11 @@ static int service_send_ping(struct mt_svc *svc) return ENOMEM; } - return sbus_conn_send(svc->conn, msg, - svc->mt_ctx->service_id_timeout, - ping_check, svc, NULL); + ret = sbus_conn_send(svc->conn, msg, + svc->mt_ctx->service_id_timeout, + ping_check, svc, NULL); + dbus_message_unref(msg); + return ret; } static void ping_check(DBusPendingCall *pending, void *data) diff --git a/src/monitor/monitor_sbus.c b/src/monitor/monitor_sbus.c index eedb60b3..43e5b685 100644 --- a/src/monitor/monitor_sbus.c +++ b/src/monitor/monitor_sbus.c @@ -111,6 +111,7 @@ int monitor_common_send_id(struct sbus_connection *conn, { DBusMessage *msg; dbus_bool_t ret; + int retval; /* create the message */ msg = dbus_message_new_method_call(NULL, @@ -133,9 +134,11 @@ int monitor_common_send_id(struct sbus_connection *conn, return EIO; } - return sbus_conn_send(conn, msg, 3000, - id_callback, - NULL, NULL); + retval = sbus_conn_send(conn, msg, 3000, + id_callback, + NULL, NULL); + dbus_message_unref(msg); + return retval; } int monitor_common_pong(DBusMessage *message, |