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 <ayala.beker@intel.com>
This commit is contained in:
Ayala Beker 2016-04-07 13:30:59 +03:00 committed by Jouni Malinen
parent 601e55726c
commit f1863f2b82
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}
}