From: Ayala Beker Date: Thu, 7 Apr 2016 10:30:59 +0000 (+0300) Subject: RADIUS: Fix possible memory leak when parsing per-STA passphrase X-Git-Tag: hostap_2_6~618 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f1863f2b829f62dfc6b1aa70aaa8ce19bb32b4d8;p=thirdparty%2Fhostap.git RADIUS: Fix possible memory leak when parsing per-STA passphrase Fix a possible memory leak in decode_tunnel_passwords() if an invalid passphrase is received from the RADIUS server. Signed-off-by: Ayala Beker --- diff --git a/src/ap/ieee802_11_auth.c b/src/ap/ieee802_11_auth.c index 96091526b..b89053736 100644 --- a/src/ap/ieee802_11_auth.c +++ b/src/ap/ieee802_11_auth.c @@ -457,7 +457,7 @@ static void decode_tunnel_passwords(struct hostapd_data *hapd, if (passphraselen < MIN_PASSPHRASE_LEN || passphraselen > MAX_PASSPHRASE_LEN + 1) - continue; + goto free_pass; /* * passphrase does not contain the NULL termination. @@ -484,6 +484,7 @@ static void decode_tunnel_passwords(struct hostapd_data *hapd, } skip: os_free(psk); +free_pass: os_free(passphrase); } }