]> git.ipfire.org Git - thirdparty/make.git/commit
Clean up memory leak warnings from ASAN and Valgrind
authorPaul Smith <psmith@gnu.org>
Sun, 26 Mar 2023 19:35:00 +0000 (15:35 -0400)
committerPaul Smith <psmith@gnu.org>
Sat, 1 Apr 2023 15:13:12 +0000 (11:13 -0400)
commit9db74434cd34b2b875b3f9bfbab4f1e0b682e27c
treeb488a9766c9e1a932518fd6e4e1db25ae6b788b5
parent23f70b0cb86208d3b9b47b0efa9707a1dac5360b
Clean up memory leak warnings from ASAN and Valgrind

* src/main.c (main): Add "sanitize" to .FEATURES if ASAN is enabled.
* src/expand.c (expand_variable_output): Remember "recursive" setting
in case it's changed by the expansion of the variable.
* src/file.c (rehash_file): If we drop a file from the global 'files'
hash, remember it in rehashed_files.  We can't free it because it's
still being referenced (callers will invoke check_renamed()) but
it will be a leak since it's no longer referenced by 'files'.
* src/remake.c (update_file_1): If we drop a dependency, remember it
in dropped_list.  We can't free it because it's still being referenced
by callers but it will be a leak since it's no longer referenced as
a prerequisite.
* tests/scripts/functions/guile: Don't run Guile tests when ASAN is
enabled.
* tests/scripts/functions/wildcard: Enabling ASAN causes glob(3) to
break!  Don't run this test.
* tests/scripts/features/exec: Valgrind's exec() doesn't support
scripts with no shbang.
* tests/scripts/jobserver: Valgrind fails if TMPDIR is set to an
invalid directory: skip those tests.
* tests/scripts/features/output-sync: Ditto.
* tests/scripts/features/temp_stdin: Ditto.
src/expand.c
src/file.c
src/main.c
src/read.c
src/remake.c
tests/scripts/features/exec
tests/scripts/features/jobserver
tests/scripts/features/output-sync
tests/scripts/features/temp_stdin
tests/scripts/functions/guile
tests/scripts/functions/wildcard