]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SAE: Fix resource leak on reading a separate password file
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 22 Jan 2024 20:00:35 +0000 (22:00 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 22 Jan 2024 20:16:46 +0000 (22:16 +0200)
The file needs to be closed on all paths before exiting from the
function.

Fixes: e748e50c629f ("SAE passwords from a separate file")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
hostapd/config_file.c

index 8933908b262ca42e7de04301971938df45289e4c..1af083917052fd6448001ed486ad57c86b2faa2f 100644 (file)
@@ -2360,10 +2360,12 @@ static int parse_sae_password_file(struct hostapd_bss_config *bss,
                        wpa_printf(MSG_ERROR,
                                   "Invalid SAE password at line %d in '%s'",
                                   line, fname);
+                       fclose(f);
                        return -1;
                }
        }
 
+       fclose(f);
        return 0;
 }