[PATCH 9/9] eap-mschapv2: Fix leak of state->user on error path

James Prestwood
2025-04-16T12:34:27Z

---
src/eap-mschapv2.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/eap-mschapv2.c b/src/eap-mschapv2.c
index 1639f578..00976d73 100644
--- a/src/eap-mschapv2.c
+++ b/src/eap-mschapv2.c
@@ -544,7 +544,8 @@ static bool eap_mschapv2_load_settings(struct eap_state *eap,
return true;

error:
- free(state);
+ l_free(state->user);
+ l_free(state);
return false;
}

--
2.34.1