mirror of
https://github.com/git/git.git
synced 2024-10-28 12:59:41 +01:00
notes-utils: free note trees when releasing copied notes
While we clear most of the members of `struct notes_rewrite_cfg` in `finish_copy_notes_for_rewrite()`, we do not clear the notes tree. Fix this to plug this memory leak. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
14da26230a
commit
bb8c43d5cd
3 changed files with 3 additions and 0 deletions
|
@ -187,6 +187,7 @@ void finish_copy_notes_for_rewrite(struct repository *r,
|
|||
for (i = 0; c->trees[i]; i++) {
|
||||
commit_notes(r, c->trees[i], msg);
|
||||
free_notes(c->trees[i]);
|
||||
free(c->trees[i]);
|
||||
}
|
||||
free(c->trees);
|
||||
free(c);
|
||||
|
|
|
@ -11,6 +11,7 @@ among other things.
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
GIT_AUTHOR_NAME=author@name
|
||||
|
|
|
@ -9,6 +9,7 @@ test_description='git commit'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY/lib-diff.sh"
|
||||
|
||||
|
|
Loading…
Reference in a new issue