From: Jouni Malinen Date: Tue, 5 Feb 2019 18:25:21 +0000 (+0200) Subject: Clear config item writing buffer before freeing it X-Git-Tag: hostap_2_8~424 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f99a3c26ace5789e515944a09beb3081f7fbee2;p=thirdparty%2Fhostap.git Clear config item writing buffer before freeing it This buffer may be used to store items like passwords, so better clean it explicitly to avoid possibility of leaving such items in heap memory unnecessarily. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index 9b14699ae..f1d865ccb 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -493,7 +493,7 @@ static void write_str(FILE *f, const char *field, struct wpa_ssid *ssid) if (value == NULL) return; fprintf(f, "\t%s=%s\n", field, value); - os_free(value); + str_clear_free(value); }