commit.c: free() revs.commit in get_fork_point()
Fix a memory leak that's been with us since d96855ff51
(merge-base:
teach "--fork-point" mode, 2013-10-23).
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
a535040887
commit
0c10ed19c4
1
commit.c
1
commit.c
@ -1033,6 +1033,7 @@ struct commit *get_fork_point(const char *refname, struct commit *commit)
|
||||
ret = bases->item;
|
||||
|
||||
cleanup_return:
|
||||
free(revs.commit);
|
||||
free_commit_list(bases);
|
||||
free(full_refname);
|
||||
return ret;
|
||||
|
@ -8,6 +8,7 @@ test_description='git rebase --fork-point test'
|
||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
# A---B---D---E (main)
|
||||
|
@ -8,6 +8,7 @@ test_description='ensure rebase fast-forwards commits when possible'
|
||||
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 '
|
||||
|
Loading…
Reference in New Issue
Block a user