3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 23:09:34 +01:00

util: guard against NULL 'freqs' in scan_freq_set_free

Since this can be used with the _auto_ macro it must be able to handle
a NULL input for error paths.
This commit is contained in:
James Prestwood 2022-08-05 10:28:01 -07:00 committed by Denis Kenzior
parent 91df2ee364
commit 69339c7a97

View File

@ -330,6 +330,9 @@ struct scan_freq_set *scan_freq_set_new(void)
void scan_freq_set_free(struct scan_freq_set *freqs) void scan_freq_set_free(struct scan_freq_set *freqs)
{ {
if (!freqs)
return;
l_uintset_free(freqs->channels_5ghz); l_uintset_free(freqs->channels_5ghz);
l_uintset_free(freqs->channels_6ghz); l_uintset_free(freqs->channels_6ghz);
l_free(freqs); l_free(freqs);