]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-SIM peer: Free imsi_privacy_key on an error path
authorJouni Malinen <quic_jouni@quicinc.com>
Mon, 23 May 2022 20:49:49 +0000 (23:49 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 23 May 2022 21:34:08 +0000 (00:34 +0300)
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 <quic_jouni@quicinc.com>
src/eap_peer/eap_sim.c

index 3b4c836d40d3157e96e6179efdc527c0df0140e4..04a213464c0c6d94735b7c5e8f5619f7372ed0a9 100644 (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;
                        }