summaryrefslogtreecommitdiffstats
path: root/src/responder
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-03-17 14:53:17 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-03-17 16:41:01 -0400
commitf1bc4e8b9daf04a5cb4b9464021bb9e816eed3ea (patch)
treee567f20493ad395a5f5b251f1f69cac6410a7789 /src/responder
parent1d065874a1aa1db06994a16dae1a78555fabf776 (diff)
downloadsssd-f1bc4e8b9daf04a5cb4b9464021bb9e816eed3ea.tar.gz
sssd-f1bc4e8b9daf04a5cb4b9464021bb9e816eed3ea.tar.xz
sssd-f1bc4e8b9daf04a5cb4b9464021bb9e816eed3ea.zip
Fix a series of memory leaks in the SBUS
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;
}