aboutsummaryrefslogtreecommitdiff
path: root/shallow.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-11-08 15:04:41 +0900
committerJunio C Hamano <gitster@pobox.com>2023-11-08 15:04:41 +0900
commitc732f7430da8d4dedccd05540eae3dc7421dcdc6 (patch)
tree2a965ad665788e71bf9143d0f844f419b3f32a7e /shallow.c
parent98009afd24e2304bf923a64750340423473809ff (diff)
parent9972cd6004ac46a919d2e8773be976ef1e2d6a65 (diff)
downloadgit-c732f7430da8d4dedccd05540eae3dc7421dcdc6.tar.xz
Merge branch 'ps/leakfixes'
Leakfix. * ps/leakfixes: setup: fix leaking repository format setup: refactor `upgrade_repository_format()` to have common exit shallow: fix memory leak when registering shallow roots test-bloom: stop setting up Git directory twice
Diffstat (limited to 'shallow.c')
-rw-r--r--shallow.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/shallow.c b/shallow.c
index 5413719fd4..ac728cdd77 100644
--- a/shallow.c
+++ b/shallow.c
@@ -38,8 +38,10 @@ int register_shallow(struct repository *r, const struct object_id *oid)
oidcpy(&graft->oid, oid);
graft->nr_parent = -1;
- if (commit && commit->object.parsed)
+ if (commit && commit->object.parsed) {
+ free_commit_list(commit->parents);
commit->parents = NULL;
+ }
return register_commit_graft(r, graft, 0);
}