]> git.ipfire.org Git - thirdparty/git.git/commit - archive.c
various: add missing clear_pathspec(), fix leaks
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 6 Feb 2023 23:07:40 +0000 (00:07 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Feb 2023 23:34:37 +0000 (15:34 -0800)
commit7615cf94d2af0f9ae71c4302092990e635f23a8f
tree5710f3628f1ff99bef13437444ccf68f3a2eb834
parent81e5c39cf63b414468adcc6601184212e68e1fc1
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>
archive.c
builtin/clean.c
builtin/reset.c
builtin/stash.c
t/t5001-archive-attr.sh
t/t5004-archive-corner-cases.sh
t/t7105-reset-patch.sh
t/t7106-reset-unborn-branch.sh
t/t7107-reset-pathspec-file.sh
t/t7301-clean-interactive.sh