Re: [PATCH 14/22] shallow: fix leaking members of `struct shallow_info`
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 29, 2024, 16:07 UTC
- Message-ID
- <xmqqr0a7wbvw.fsf@gitster.g>
- In-Reply-To
- <87ed67jtxy.fsf@iotcl.com>
Toon claes <toon@iotcl.com> writes:
Show 17 quoted lines
>> 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);
>> }
>
> `prepare_shallow_info()`, which allocates new memory. So would it be
> worth to rename this function to `release_shallow_info()`?In the longer term in a separate "renaming everything" effort, yes. In the context of "plug many resource leaks" series, probably no.
Thanks.