From: Jouni Malinen Date: Mon, 23 May 2022 20:49:49 +0000 (+0300) Subject: EAP-SIM peer: Free imsi_privacy_key on an error path X-Git-Tag: hostap_2_11~1891 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35eda6e70008c0e69a11a9abbb2a2095ac21f600;p=thirdparty%2Fhostap.git EAP-SIM peer: Free imsi_privacy_key on an error path This is an allocated resource so it needs to be free on the error path. Fixes: 42871a5d25ea ("EAP-SIM/AKA peer: IMSI privacy") Signed-off-by: Jouni Malinen --- diff --git a/src/eap_peer/eap_sim.c b/src/eap_peer/eap_sim.c index 3b4c836d4..04a213464 100644 --- a/src/eap_peer/eap_sim.c +++ b/src/eap_peer/eap_sim.c @@ -133,6 +133,9 @@ static void * eap_sim_init(struct eap_sm *sm) "sim_min_num_chal configuration " "(%lu, expected 2 or 3)", (unsigned long) data->min_num_chal); +#ifdef CRYPTO_RSA_OAEP_SHA256 + crypto_rsa_key_free(data->imsi_privacy_key); +#endif /* CRYPTO_RSA_OAEP_SHA256 */ os_free(data); return NULL; }