From c03377cf27d5971fab233bb8eee9f95a65ff9f5b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 22 Jan 2024 22:00:35 +0200 Subject: [PATCH] SAE: Fix resource leak on reading a separate password file 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 --- hostapd/config_file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 8933908b2..1af083917 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -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; } -- 2.47.2