diff options
| author | Junio C Hamano <gitster@pobox.com> | 2023-11-08 15:04:41 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-11-08 15:04:41 +0900 |
| commit | c732f7430da8d4dedccd05540eae3dc7421dcdc6 (patch) | |
| tree | 2a965ad665788e71bf9143d0f844f419b3f32a7e /shallow.c | |
| parent | 98009afd24e2304bf923a64750340423473809ff (diff) | |
| parent | 9972cd6004ac46a919d2e8773be976ef1e2d6a65 (diff) | |
| download | git-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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); } |
