From 169aa04570a43043b4db9f6e363f56ffff03b01f Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Wed, 29 Apr 2015 01:00:21 +0200 Subject: [PATCH] eapol: Free eapol_sm even if callback is null If deauthenticate callback was not provided, the state machine was not being freed / removed. --- src/eapol.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/eapol.c b/src/eapol.c index 55247833..92a9b610 100644 --- a/src/eapol.c +++ b/src/eapol.c @@ -560,10 +560,9 @@ void eapol_cancel(uint32_t ifindex) static inline void handshake_failed(uint32_t ifindex, struct eapol_sm *sm, uint16_t reason_code) { - if (!deauthenticate) - return; - - deauthenticate(ifindex, sm->aa, sm->spa, reason_code, sm->user_data); + if (deauthenticate) + deauthenticate(ifindex, sm->aa, sm->spa, reason_code, + sm->user_data); l_queue_remove(state_machines, sm); eapol_sm_free(sm);