]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Clear config item writing buffer before freeing it
authorJouni Malinen <jouni@codeaurora.org>
Tue, 5 Feb 2019 18:25:21 +0000 (20:25 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 5 Feb 2019 18:26:22 +0000 (20:26 +0200)
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 <jouni@codeaurora.org>
wpa_supplicant/config_file.c

index 9b14699aefa9d0827f383e2f41a15e619d6feaa8..f1d865ccb8a3299993c7c5486d8ac04808876da0 100644 (file)
@@ -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);
 }