On Mon, Nov 06, 2023 at 11:45:57AM +0100, Patrick Steinhardt wrote: > --- 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); > } Good catch. When I've dealt with leaks around commit_lists in the past, one gotcha is that sometimes we've saved a pointer to the list elsewhere. But in this case it looks pretty clear that the parent list just goes away. So this patch is doing the right thing. -Peff