mirror of
https://github.com/Yubico/yubico-pam.git
synced 2025-01-31 16:52:19 +01:00
fixup a memory leak
the caller is responsible for freeing the pam_response from conversations
This commit is contained in:
parent
168bfc7bbb
commit
057c3743c9
@ -384,6 +384,7 @@ display_error(pam_handle_t *pamh, const char *message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
D(("conv returned: '%s'", resp->resp));
|
D(("conv returned: '%s'", resp->resp));
|
||||||
|
free(resp);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
#endif /* HAVE_CR */
|
#endif /* HAVE_CR */
|
||||||
@ -728,7 +729,7 @@ pam_sm_authenticate (pam_handle_t * pamh,
|
|||||||
struct pam_conv *conv;
|
struct pam_conv *conv;
|
||||||
const struct pam_message *pmsg[1];
|
const struct pam_message *pmsg[1];
|
||||||
struct pam_message msg[1];
|
struct pam_message msg[1];
|
||||||
struct pam_response *resp;
|
struct pam_response *resp = NULL;
|
||||||
int nargs = 1;
|
int nargs = 1;
|
||||||
ykclient_t *ykc = NULL;
|
ykclient_t *ykc = NULL;
|
||||||
struct cfg cfg_st;
|
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;
|
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);
|
retval = conv->conv (nargs, pmsg, &resp, conv->appdata_ptr);
|
||||||
|
|
||||||
@ -1016,6 +1016,9 @@ done:
|
|||||||
DBG (("done. [%s]", pam_strerror (pamh, retval)));
|
DBG (("done. [%s]", pam_strerror (pamh, retval)));
|
||||||
pam_set_data (pamh, "yubico_setcred_return", (void*) (intptr_t) retval, NULL);
|
pam_set_data (pamh, "yubico_setcred_return", (void*) (intptr_t) retval, NULL);
|
||||||
|
|
||||||
|
if (resp)
|
||||||
|
free (resp);
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user