From: Michael Braun Date: Thu, 18 May 2017 13:21:54 +0000 (+0200) Subject: Fix potential memory leak with identity/radius_cui X-Git-Tag: hostap_2_7~460 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17a8a9893ff535231ad6bf15134abd73af2acb8d;p=thirdparty%2Fhostap.git Fix potential memory leak with identity/radius_cui 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 --- diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 6dafb900c..b5e2b7594 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -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;