From 94e97eb1837adc2db5cd5c46e840307ba6e40d68 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 20 Jul 2026 09:42:39 +0200 Subject: [PATCH] eap-ttls: Fix memory leaks in error cases related to EAP-Identity handling Should be rare that the eap-identity plugin is not loaded when authenticating clients with EAP. And the second error path will currently never get used as `process()` always succeeds. Fixes: 79f2102cb442 ("implemented server side support for EAP-TTLS") --- src/libcharon/plugins/eap_ttls/eap_ttls_server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcharon/plugins/eap_ttls/eap_ttls_server.c b/src/libcharon/plugins/eap_ttls/eap_ttls_server.c index fc97f811c..86f503765 100644 --- a/src/libcharon/plugins/eap_ttls/eap_ttls_server.c +++ b/src/libcharon/plugins/eap_ttls/eap_ttls_server.c @@ -231,14 +231,15 @@ METHOD(tls_application_t, process, status_t, { DBG1(DBG_IKE, "%N method not available", eap_type_names, EAP_IDENTITY); + in->destroy(in); return FAILED; } } if (this->method->process(this->method, in, &this->out) != SUCCESS) { - DBG1(DBG_IKE, "%N method failed", eap_type_names, EAP_IDENTITY); + in->destroy(in); return FAILED; }