ls-files: fix a --with-tree memory leak
Fix a memory leak in overlay_tree_on_index(), we need to clear_pathspec() at some point, which might as well be after the last time we use it in the function. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>
This commit is contained in:
parent
fc47252d5b
commit
c07ce0602a
@ -613,6 +613,7 @@ void overlay_tree_on_index(struct index_state *istate,
|
||||
if (!fn)
|
||||
fn = read_one_entry_quick;
|
||||
err = read_tree(the_repository, tree, &pathspec, fn, istate);
|
||||
clear_pathspec(&pathspec);
|
||||
if (err)
|
||||
die("unable to read tree entries %s", tree_name);
|
||||
|
||||
|
@ -8,6 +8,8 @@ test_description='git ls-files test (--with-tree).
|
||||
This test runs git ls-files --with-tree and in particular in
|
||||
a scenario known to trigger a crash with some versions of git.
|
||||
'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup' '
|
||||
|
@ -5,7 +5,6 @@
|
||||
|
||||
test_description='git svn propset tests'
|
||||
|
||||
TEST_FAILS_SANITIZE_LEAK=true
|
||||
. ./lib-git-svn.sh
|
||||
|
||||
test_expect_success 'setup propset via import' '
|
||||
|
Loading…
Reference in New Issue
Block a user