summaryrefslogtreecommitdiffstats
path: root/src/responder
diff options
context:
space:
mode:
Diffstat (limited to 'src/responder')
-rw-r--r--src/responder/common/responder_dp.c5
-rw-r--r--src/responder/pam/pamsrv_dp.c8
2 files changed, 6 insertions, 7 deletions
diff --git a/src/responder/common/responder_dp.c b/src/responder/common/responder_dp.c
index 001661ca6..9f8f5263d 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 d9431f225..40d4f3031 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;
}