diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/monitor/monitor.c | 19 | ||||
-rw-r--r-- | src/monitor/monitor_sbus.c | 9 | ||||
-rw-r--r-- | src/providers/dp_auth_util.c | 6 | ||||
-rw-r--r-- | src/responder/common/responder_dp.c | 5 | ||||
-rw-r--r-- | src/responder/pam/pamsrv_dp.c | 8 |
5 files changed, 30 insertions, 17 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, diff --git a/src/providers/dp_auth_util.c b/src/providers/dp_auth_util.c index e78884aa..fb10ced0 100644 --- a/src/providers/dp_auth_util.c +++ b/src/providers/dp_auth_util.c @@ -338,6 +338,7 @@ int dp_common_send_id(struct sbus_connection *conn, uint16_t version, { DBusMessage *msg; dbus_bool_t ret; + int retval; /* create the message */ msg = dbus_message_new_method_call(NULL, @@ -361,6 +362,9 @@ int dp_common_send_id(struct sbus_connection *conn, uint16_t version, return EIO; } - return sbus_conn_send(conn, msg, 30000, id_callback, NULL, NULL); + retval = sbus_conn_send(conn, msg, 30000, id_callback, NULL, NULL); + + dbus_message_unref(msg); + return retval; } diff --git a/src/responder/common/responder_dp.c b/src/responder/common/responder_dp.c index 001661ca..9f8f5263 100644 --- a/src/responder/common/responder_dp.c +++ b/src/responder/common/responder_dp.c @@ -464,6 +464,7 @@ static int sss_dp_send_acct_req_create(struct resp_ctx *rctx, ret = sbus_conn_send(be_conn->conn, msg, timeout, sss_dp_send_acct_callback, sdp_req, &pending_reply); + dbus_message_unref(msg); if (ret != EOK) { /* * Critical Failure @@ -471,7 +472,6 @@ static int sss_dp_send_acct_req_create(struct resp_ctx *rctx, * We'll drop it using the default destructor. */ DEBUG(0, ("D-BUS send failed.\n")); - dbus_message_unref(msg); return EIO; } @@ -481,7 +481,6 @@ static int sss_dp_send_acct_req_create(struct resp_ctx *rctx, if (callback) { cb = talloc_zero(callback_memctx, struct sss_dp_callback); if (!cb) { - dbus_message_unref(msg); talloc_zfree(sdp_req); return ENOMEM; } @@ -493,8 +492,6 @@ static int sss_dp_send_acct_req_create(struct resp_ctx *rctx, talloc_set_destructor((TALLOC_CTX *)cb, sss_dp_callback_destructor); } - dbus_message_unref(msg); - *ndp = sdp_req; return EOK; diff --git a/src/responder/pam/pamsrv_dp.c b/src/responder/pam/pamsrv_dp.c index d9431f22..40d4f303 100644 --- a/src/responder/pam/pamsrv_dp.c +++ b/src/responder/pam/pamsrv_dp.c @@ -118,8 +118,10 @@ int pam_dp_send_req(struct pam_auth_req *preq, int timeout) return EIO; } - return sbus_conn_send(be_conn->conn, msg, - timeout, pam_dp_process_reply, - preq, NULL); + res = sbus_conn_send(be_conn->conn, msg, + timeout, pam_dp_process_reply, + preq, NULL); + dbus_message_unref(msg); + return res; } |