summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)