summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-06-09 09:44:47 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-06-10 10:17:38 -0400
commitf37bf8657971d16a4849f58242319699dca2de95 (patch)
treedf530e763f148621d708a72a53019fe3b7b2e40c /src
parent9eab847bc1a30ebf4ab27f739d6972402262d045 (diff)
downloadsssd-f37bf8657971d16a4849f58242319699dca2de95.tar.gz
sssd-f37bf8657971d16a4849f58242319699dca2de95.tar.xz
sssd-f37bf8657971d16a4849f58242319699dca2de95.zip
Avoid potential NULL dereference
https://fedorahosted.org/sssd/ticket/506
Diffstat (limited to 'src')
-rw-r--r--src/providers/ipa/ipa_auth.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/providers/ipa/ipa_auth.c b/src/providers/ipa/ipa_auth.c
index 6f062adc1..2bd92ba79 100644
--- a/src/providers/ipa/ipa_auth.c
+++ b/src/providers/ipa/ipa_auth.c
@@ -232,6 +232,7 @@ void ipa_auth(struct be_req *be_req)
{
struct tevent_req *req;
struct ipa_auth_state *state;
+ struct pam_data *pd = talloc_get_type(be_req->req_data, struct pam_data);
state = talloc_zero(be_req, struct ipa_auth_state);
if (state == NULL) {
@@ -245,7 +246,7 @@ void ipa_auth(struct be_req *be_req)
state->be_req = be_req;
state->ev = be_req->be_ctx->ev;
- state->pd = talloc_get_type(be_req->req_data, struct pam_data);
+ state->pd = pd;
switch (state->pd->cmd) {
case SSS_PAM_AUTHENTICATE:
@@ -275,8 +276,9 @@ void ipa_auth(struct be_req *be_req)
return;
fail:
- state->pd->pam_status = PAM_SYSTEM_ERR;
- ipa_auth_reply(be_req, DP_ERR_FATAL, state->pd->pam_status);
+ talloc_free(state);
+ pd->pam_status = PAM_SYSTEM_ERR;
+ ipa_auth_reply(be_req, DP_ERR_FATAL, pd->pam_status);
}
static void ipa_auth_handler_done(struct tevent_req *req)