Fix memory leak in error path.

*info is allocated via xstrdup but was leaked in the PAM_AUTH_ERR path.
From github PR#266.
This commit is contained in:
Shchelkunov Artem 2021-08-11 18:07:58 +05:00 committed by Darren Tucker
parent cb37e2f0c0
commit 1ff38f34b4

View File

@ -886,6 +886,7 @@ sshpam_query(void *ctx, char **name, char **info,
case PAM_AUTH_ERR:
debug3("PAM: %s", pam_strerror(sshpam_handle, type));
if (**prompts != NULL && strlen(**prompts) != 0) {
free(*info);
*info = **prompts;
**prompts = NULL;
*num = 0;