From 635c1e1a8ade80a688da09961119723170338990 Mon Sep 17 00:00:00 2001 From: Fred Klassen Date: Tue, 4 Jun 2024 21:16:44 -0700 Subject: [PATCH 1/2] Bug #869 - free option->xX on exit --- docs/CHANGELOG | 1 + src/tcpprep.c | 2 -- src/tcpprep_api.c | 8 ++++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 87dd4964..85bd728f 100644 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -1,4 +1,5 @@ 06/03/2024 Version 4.5.0-beta1 + - memory leak in tcpprep when using include/exclude (#869) - memory leak in tcpprep when using RegEx (#867) - fix nansecond timestamp regression bug (#863) - autotools - AC_HELP_STRING is obsolete in 2.70 (#856) diff --git a/src/tcpprep.c b/src/tcpprep.c index 6a5f7830..83824766 100644 --- a/src/tcpprep.c +++ b/src/tcpprep.c @@ -195,8 +195,6 @@ main(int argc, char *argv[]) /* close cache file */ close(out_file); - regfree(&tcpprep->options->preg); - tcpprep_close(tcpprep); restore_stdin(); diff --git a/src/tcpprep_api.c b/src/tcpprep_api.c index 2a9709eb..25f9a851 100644 --- a/src/tcpprep_api.c +++ b/src/tcpprep_api.c @@ -91,6 +91,14 @@ tcpprep_close(tcpprep_t *ctx) cidr = cidr_nxt; } + if (options->xX.list) + free_list(options->xX.list); + + if (options->xX.cidr) + safe_free(options->xX.cidr); + + regfree(&options->preg); + safe_free(options); safe_free(ctx->outfile); From a1a47354d222fadee81e831dbb7bdf2f0cc8fe61 Mon Sep 17 00:00:00 2001 From: Fred Klassen Date: Tue, 4 Jun 2024 21:17:55 -0700 Subject: [PATCH 2/2] Bug #869 - GitHub Actions CI - enable ASAN --- .github/workflows/github-actions-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions-ci.yml b/.github/workflows/github-actions-ci.yml index 8a9882d5..1b81f614 100644 --- a/.github/workflows/github-actions-ci.yml +++ b/.github/workflows/github-actions-ci.yml @@ -18,7 +18,7 @@ jobs: - name: Create configure script run: ./autogen.sh - name: configure - run: ./configure --with-testnic=eth0 --disable-local-libopts + run: ./configure --with-testnic=eth0 --disable-local-libopts --enable-asan - name: make run: make - name: make dist