Skip to content

Commit 748bd09

Browse files
pks-tgitster
authored andcommitted
builtin/stash: fix leak in show_stash()
We leak the `revision_args()` variable. Fix this. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a90a089 commit 748bd09

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

builtin/stash.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,9 @@ static int show_stash(int argc, const char **argv, const char *prefix)
975975
log_tree_diff_flush(&rev);
976976

977977
ret = diff_result_code(&rev.diffopt);
978+
978979
cleanup:
980+
strvec_clear(&revision_args);
979981
strvec_clear(&stash_args);
980982
free_stash_info(&info);
981983
release_revisions(&rev);

t/t3420-rebase-autostash.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ test_description='git rebase --autostash tests'
77
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
88
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
99

10+
TEST_PASSES_SANITIZE_LEAK=true
1011
. ./test-lib.sh
1112

1213
test_expect_success setup '

t/t3907-stash-show-config.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='Test git stash show configuration.'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./test-lib.sh
67

78
test_expect_success 'setup' '

0 commit comments

Comments
 (0)