diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2023-02-07 02:07:40 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-02-07 02:34:37 +0300 |
commit | 7615cf94d2af0f9ae71c4302092990e635f23a8f (patch) | |
tree | 5710f3628f1ff99bef13437444ccf68f3a2eb834 /t/t7107-reset-pathspec-file.sh | |
parent | 81e5c39cf63b414468adcc6601184212e68e1fc1 (diff) |
various: add missing clear_pathspec(), fix leaks
Fix memory leaks resulting from a missing clear_pathspec().
- archive.c: Plug a leak in the "struct archiver_args", and
clear_pathspec() the "pathspec" member that the "parse_pathspec_arg()"
call in this function populates.
- builtin/clean.c: Fix a memory leak that's been with us since
893d839970c (clean: convert to use parse_pathspec, 2013-07-14).
- builtin/reset.c: Add clear_pathspec() calls to cmd_reset(),
including to the codepaths where we'd return early.
- builtin/stash.c: Call clear_pathspec() on the pathspec initialized
in push_stash().
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7107-reset-pathspec-file.sh')
-rwxr-xr-x | t/t7107-reset-pathspec-file.sh | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/t/t7107-reset-pathspec-file.sh b/t/t7107-reset-pathspec-file.sh index 523efbecde..af5ea406db 100755 --- a/t/t7107-reset-pathspec-file.sh +++ b/t/t7107-reset-pathspec-file.sh @@ -2,6 +2,7 @@ test_description='reset --pathspec-from-file' +TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh test_tick |