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: 42871a5d25 ("EAP-SIM/AKA peer: IMSI privacy")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
Jouni Malinen 2022-05-23 23:49:49 +03:00 committed by Jouni Malinen
parent 1328cdeb19
commit 35eda6e700

View file

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