]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wlantest: Delete each entry from the WEP list before freeing the entry
authorGokul Sivakumar <gokulkumar792@gmail.com>
Wed, 3 Nov 2021 16:50:23 +0000 (22:20 +0530)
committerJouni Malinen <j@w1.fi>
Sat, 11 Dec 2021 19:53:40 +0000 (21:53 +0200)
To be consistent with how all the other dl lists like passphrase, PMK,
and PTK lists are freed, delete each entry from the WEP list before
freeing the entry.

Signed-off-by: Gokul Sivakumar <gokulkumar792@gmail.com>
wlantest/wlantest.c

index f69bdce1fb4f4cdd05ab51d0bb2156cc2658475f..e1a3e0650fca3f98e6b86351d54deb7a2d6ad022 100644 (file)
@@ -77,6 +77,13 @@ static void ptk_deinit(struct wlantest_ptk *ptk)
 }
 
 
+static void wep_deinit(struct wlantest_wep *wep)
+{
+       dl_list_del(&wep->list);
+       os_free(wep);
+}
+
+
 static void wlantest_deinit(struct wlantest *wt)
 {
        struct wlantest_passphrase *p, *pn;
@@ -104,7 +111,7 @@ static void wlantest_deinit(struct wlantest *wt)
        dl_list_for_each_safe(ptk, npt, &wt->ptk, struct wlantest_ptk, list)
                ptk_deinit(ptk);
        dl_list_for_each_safe(wep, nw, &wt->wep, struct wlantest_wep, list)
-               os_free(wep);
+               wep_deinit(wep);
        write_pcap_deinit(wt);
        write_pcapng_deinit(wt);
        clear_notes(wt);