From: Jouni Malinen Date: Mon, 23 Sep 2013 13:22:16 +0000 (+0300) Subject: Clear frequency list on empty value X-Git-Tag: hostap_2_1~933 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6668efda5813b87c43cfb6780c60dfebe0b9da4c;p=thirdparty%2Fhostap.git Clear frequency list on empty value Allow current frequency list of be cleared with an empty string value. Signed-hostap: Jouni Malinen --- diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index 5c9f39e99..5ab11281e 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -873,6 +873,10 @@ static int wpa_config_parse_scan_freq(const struct parse_data *data, freqs = wpa_config_parse_int_array(value); if (freqs == NULL) return -1; + if (freqs[0] == 0) { + os_free(freqs); + freqs = NULL; + } os_free(ssid->scan_freq); ssid->scan_freq = freqs; @@ -889,6 +893,10 @@ static int wpa_config_parse_freq_list(const struct parse_data *data, freqs = wpa_config_parse_int_array(value); if (freqs == NULL) return -1; + if (freqs[0] == 0) { + os_free(freqs); + freqs = NULL; + } os_free(ssid->freq_list); ssid->freq_list = freqs; @@ -2808,6 +2816,10 @@ static int wpa_config_process_freq_list(const struct global_parse_data *data, freqs = wpa_config_parse_int_array(value); if (freqs == NULL) return -1; + if (freqs[0] == 0) { + os_free(freqs); + freqs = NULL; + } os_free(config->freq_list); config->freq_list = freqs; return 0;