void-packages/srcpkgs/audit/patches/0002-Fix-memleak-in-auparse-caused-by-corrected-event-ord.patch
Nathan Owens 3bb10ea3e6 audit: add memory leak patches
Signed-off-by: Nathan Owens <ndowens04@gmail.com>
2019-12-09 14:34:13 +01:00

41 lines
1.1 KiB
Diff

From ce0debf94f93d787d3bed635952133b2a5ff3551 Mon Sep 17 00:00:00 2001
From: Steve Grubb <sgrubb@redhat.com>
Date: Tue, 26 Mar 2019 17:24:37 -0400
Subject: [PATCH 2/2] Fix memleak in auparse caused by corrected event ordering
part 2
---
auparse/auparse.c | 17 -----------------
1 file changed, 17 deletions(-)
diff --git auparse/auparse.c auparse/auparse.c
index ecea88e..5318d25 100644
--- auparse/auparse.c
+++ auparse/auparse.c
@@ -259,23 +259,6 @@ static event_list_t *au_get_ready_event(auparse_state_t *au, int is_test)
if (lowest && lowest->status == EBS_COMPLETE) {
lowest->status = EBS_EMPTY;
au->au_ready--;
- // Try to consolidate the array so that we iterate
- // over a smaller portion next time
- if (lowest == &lol->array[lol->maxi]) {
- 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];
- }
- }
return lowest->l;
}
--
2.24.0