From c2544c220bb1b1045589ceae3dbb69f195b860e5 Mon Sep 17 00:00:00 2001 From: Steve Grubb Date: Tue, 26 Mar 2019 09:18:00 -0400 Subject: [PATCH 1/2] Fix memleak in auparse caused by corrected event ordering --- auparse/auparse.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git auparse/auparse.c auparse/auparse.c index 34aa90c..ecea88e 100644 --- auparse/auparse.c +++ auparse/auparse.c @@ -265,6 +265,14 @@ static event_list_t *au_get_ready_event(auparse_state_t *au, int is_test) au_lolnode *ptr = lowest; while (ptr->status == EBS_EMPTY && lol->maxi > 0) { lol->maxi--; + if (ptr->l) { + aup_list_clear(ptr->l); + free(ptr->l); + ptr->l = NULL; + au->le = NULL; // this should crash + // usage of au->le + // until reset + } ptr = &lol->array[lol->maxi]; } } -- 2.24.0