shallow: fix leaking members of struct shallow_info
We do not free several struct members in `clear_shallow_info()`. Fix this to plug the resulting leaks. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
14c0ea0f6f
commit
16c6fb5a94
@ -489,6 +489,15 @@ void prepare_shallow_info(struct shallow_info *info, struct oid_array *sa)
|
||||
|
||||
void clear_shallow_info(struct shallow_info *info)
|
||||
{
|
||||
if (info->used_shallow) {
|
||||
for (size_t i = 0; i < info->shallow->nr; i++)
|
||||
free(info->used_shallow[i]);
|
||||
free(info->used_shallow);
|
||||
}
|
||||
|
||||
free(info->need_reachability_test);
|
||||
free(info->reachable);
|
||||
free(info->shallow_ref);
|
||||
free(info->ours);
|
||||
free(info->theirs);
|
||||
}
|
||||
|
Reference in New Issue
Block a user