]> git.ipfire.org Git - thirdparty/git.git/commitdiff
builtin/stash: fix leak in `show_stash()`
authorPatrick Steinhardt <ps@pks.im>
Tue, 11 Jun 2024 09:20:28 +0000 (11:20 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Jun 2024 20:15:06 +0000 (13:15 -0700)
We leak the `revision_args()` variable. Fix this.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/stash.c
t/t3420-rebase-autostash.sh
t/t3907-stash-show-config.sh

index 628d848a0bc85d3053fc82805710a1ebfb5d66ed..1ed0a9a5d967fd6b372e41fae7d0c168b2f0b258 100644 (file)
@@ -975,7 +975,9 @@ static int show_stash(int argc, const char **argv, const char *prefix)
        log_tree_diff_flush(&rev);
 
        ret = diff_result_code(&rev.diffopt);
+
 cleanup:
+       strvec_clear(&revision_args);
        strvec_clear(&stash_args);
        free_stash_info(&info);
        release_revisions(&rev);
index 1a820f148155cbc65e2e1ad07275e25510e083b9..63e400b89f225a48db6552540195d472a142547e 100755 (executable)
@@ -7,6 +7,7 @@ test_description='git rebase --autostash tests'
 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success setup '
index 10914bba7b3737ea89af320f93371e44b4694a11..7a2eb98b86426ea7657fdce73cb8c0cb3a6d2848 100755 (executable)
@@ -2,6 +2,7 @@
 
 test_description='Test git stash show configuration.'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'setup' '