summaryrefslogtreecommitdiffstats
path: root/auth-pam.c
diff options
context:
space:
mode:
authorShchelkunov Artem <a.shchelkunov@ideco.ru>2021-08-11 15:07:58 +0200
committerDarren Tucker <dtucker@dtucker.net>2021-09-03 05:42:08 +0200
commit1ff38f34b4c4545eb28106629cafa1e0496bc726 (patch)
tree04565ea5deb889a79e0578226c43ef33cf3cdab7 /auth-pam.c
parentupstream: Fix ssh-rsa fallback for old PuTTY interop tests. (diff)
downloadopenssh-1ff38f34b4c4545eb28106629cafa1e0496bc726.tar.xz
openssh-1ff38f34b4c4545eb28106629cafa1e0496bc726.zip
Fix memory leak in error path.
*info is allocated via xstrdup but was leaked in the PAM_AUTH_ERR path. From github PR#266.
Diffstat (limited to 'auth-pam.c')
-rw-r--r--auth-pam.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/auth-pam.c b/auth-pam.c
index f39d03f4b..29034e40d 100644
--- a/auth-pam.c
+++ b/auth-pam.c
@@ -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;