]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix corner case that might lead to leaked file descriptor
authorArne Schwabe <arne@rfc2549.org>
Thu, 15 Dec 2022 19:01:42 +0000 (20:01 +0100)
committerGert Doering <gert@greenie.muc.de>
Fri, 16 Dec 2022 17:34:54 +0000 (18:34 +0100)
Reported-By: Trail of Bits
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20221215190143.2107896-8-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25730.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/misc.c

index d78106cdc3836c3d12e43ed5d2e1b915e3ec8987..551606e0e46e56970da64feaa6b8d727a4fb56c2 100644 (file)
@@ -258,6 +258,7 @@ get_user_pass_cr(struct user_pass *up,
                 msg(D_LOW, "No password found in %s authfile '%s'. Querying the management interface", prefix, auth_file);
                 if (!auth_user_pass_mgmt(up, prefix, flags, auth_challenge))
                 {
+                    fclose(fp);
                     return false;
                 }
             }