From: Jouni Malinen Date: Mon, 22 Jan 2024 20:00:35 +0000 (+0200) Subject: SAE: Fix resource leak on reading a separate password file X-Git-Tag: hostap_2_11~430 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c03377cf27d5971fab233bb8eee9f95a65ff9f5b;p=thirdparty%2Fhostap.git 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 --- 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; }