1
0
mirror of https://github.com/Yubico/yubico-pam.git synced 2025-01-19 07:52:23 +01:00

fixup a memory leak

the caller is responsible for freeing the pam_response from
conversations
This commit is contained in:
Klas Lindfors 2015-01-16 10:14:22 +01:00
parent 168bfc7bbb
commit 057c3743c9

View File

@ -384,6 +384,7 @@ display_error(pam_handle_t *pamh, const char *message) {
}
D(("conv returned: '%s'", resp->resp));
free(resp);
return retval;
}
#endif /* HAVE_CR */
@ -728,7 +729,7 @@ pam_sm_authenticate (pam_handle_t * pamh,
struct pam_conv *conv;
const struct pam_message *pmsg[1];
struct pam_message msg[1];
struct pam_response *resp;
struct pam_response *resp = NULL;
int nargs = 1;
ykclient_t *ykc = NULL;
struct cfg cfg_st;
@ -875,7 +876,6 @@ pam_sm_authenticate (pam_handle_t * pamh,
}
}
msg[0].msg_style = cfg->verbose_otp ? PAM_PROMPT_ECHO_ON : PAM_PROMPT_ECHO_OFF;
resp = NULL;
retval = conv->conv (nargs, pmsg, &resp, conv->appdata_ptr);
@ -1016,6 +1016,9 @@ done:
DBG (("done. [%s]", pam_strerror (pamh, retval)));
pam_set_data (pamh, "yubico_setcred_return", (void*) (intptr_t) retval, NULL);
if (resp)
free (resp);
return retval;
}