From 17a8a9893ff535231ad6bf15134abd73af2acb8d Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Thu, 18 May 2017 15:21:54 +0200 Subject: [PATCH] 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 --- src/ap/ieee802_11.c | 3 +++ 1 file changed, 3 insertions(+) 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;