Browse code

Fix corner case that might lead to leaked file descriptor

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>
(cherry picked from commit a034dc8153522713c3cfda90b2cda114cea70e2d)

Arne Schwabe authored on 2022/12/16 04:01:42
Showing 1 changed files
... ...
@@ -273,6 +273,7 @@ get_user_pass_cr(struct user_pass *up,
273 273
                 msg(D_LOW, "No password found in %s authfile '%s'. Querying the management interface", prefix, auth_file);
274 274
                 if (!auth_user_pass_mgmt(up, prefix, flags, auth_challenge))
275 275
                 {
276
+                    fclose(fp);
276 277
                     return false;
277 278
                 }
278 279
             }