]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Fix memory leak in error path.
authorShchelkunov Artem <a.shchelkunov@ideco.ru>
Wed, 11 Aug 2021 13:07:58 +0000 (18:07 +0500)
committerDarren Tucker <dtucker@dtucker.net>
Fri, 3 Sep 2021 03:42:08 +0000 (13:42 +1000)
*info is allocated via xstrdup but was leaked in the PAM_AUTH_ERR path.
From github PR#266.

auth-pam.c

index f39d03f4b18ee6faf7fce3d08ae196daa58c2e27..29034e40d655e44f43f3f8cc243e66f679aa0e11 100644 (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;