Skip to content

Commit

Permalink
Merge pull request appneta#870 from appneta/Bug_#869_tcpprep_memory_l…
Browse files Browse the repository at this point in the history
…eak_include_exclude

Bug appneta#869 tcpprep memory leak include exclude
  • Loading branch information
fklassen authored Jun 5, 2024
2 parents d16b027 + a1a4735 commit da44ab1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/github-actions-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 0 additions & 2 deletions src/tcpprep.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,6 @@ main(int argc, char *argv[])
/* close cache file */
close(out_file);

regfree(&tcpprep->options->preg);

tcpprep_close(tcpprep);

restore_stdin();
Expand Down
8 changes: 8 additions & 0 deletions src/tcpprep_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit da44ab1

Please sign in to comment.