From 9a9ff9f2f3cca137198d11515e9e5a48ab1c2989 Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Fri, 23 Aug 2019 03:30:25 +0200 Subject: [PATCH] eapol: Don't l_queue_remove from state_machines while destroying it We do an l_queue_destroy(state_machines, eapol_sm_destroy) so don't l_queue_remove from state_machines inside eapol_sm_destroy. --- src/eapol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/eapol.c b/src/eapol.c index f1a9d8d0..043c8328 100644 --- a/src/eapol.c +++ b/src/eapol.c @@ -863,8 +863,6 @@ static void eapol_sm_destroy(void *value) explicit_bzero(sm->installed_igtk, sizeof(sm->installed_igtk)); l_free(sm); - - l_queue_remove(state_machines, sm); } struct eapol_sm *eapol_sm_new(struct handshake_state *hs) @@ -886,6 +884,8 @@ struct eapol_sm *eapol_sm_new(struct handshake_state *hs) void eapol_sm_free(struct eapol_sm *sm) { eapol_sm_destroy(sm); + + l_queue_remove(state_machines, sm); } void eapol_sm_set_listen_interval(struct eapol_sm *sm, uint16_t interval)