]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix potential memory leak with identity/radius_cui
authorMichael Braun <michael-dev@fami-braun.de>
Thu, 18 May 2017 13:21:54 +0000 (15:21 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 6 Apr 2018 16:01:16 +0000 (19:01 +0300)
ieee802_11_set_radius_info() might be called with a STA entry that has
already stored identity and/or radius_cui information, so make sure the
old values get freed before being replaced by the new ones.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
src/ap/ieee802_11.c

index 6dafb900cd68e2fc0927a6b52219870c1756aa00..b5e2b7594bd176a09ae745c2eada3470a80f86d9 100644 (file)
@@ -1648,8 +1648,11 @@ ieee802_11_set_radius_info(struct hostapd_data *hapd, struct sta_info *sta,
                sta->psk = NULL;
        }
 
+       os_free(sta->identity);
        sta->identity = *identity;
        *identity = NULL;
+
+       os_free(sta->radius_cui);
        sta->radius_cui = *radius_cui;
        *radius_cui = NULL;