From: Arne Schwabe Date: Thu, 15 Dec 2022 19:01:42 +0000 (+0100) Subject: Fix corner case that might lead to leaked file descriptor X-Git-Tag: v2.7_alpha1~635 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a034dc8153522713c3cfda90b2cda114cea70e2d;p=thirdparty%2Fopenvpn.git Fix corner case that might lead to leaked file descriptor Reported-By: Trail of Bits Signed-off-by: Arne Schwabe Acked-by: Gert Doering 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 --- diff --git a/src/openvpn/misc.c b/src/openvpn/misc.c index d78106cdc..551606e0e 100644 --- a/src/openvpn/misc.c +++ b/src/openvpn/misc.c @@ -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; } }