Subject: Re: [PATCH v5 18/27] revisions API: have release_revisions() release "cmdline"

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Sun, 03 Apr 2022 16:01:39 +0200

On Sun, Apr 03 2022, Phillip Wood wrote:

> Hi Ævar
>
> On 02/04/2022 11:49, Ævar Arnfjörð Bjarmason wrote:
>>   +static void release_revisions_cmdline(struct rev_cmdline_info
>> *cmdline)
>> +{
>> +	unsigned int i;
>> +
>> +	if (!cmdline)
>> +		return;
>
> I don't think we need this guard, the only instances of struct
> rev_cmdline_info exist within struct rev_info, as far as I can see it
> is never created on its own.

Yes, it won't ever be NULL. I'll fix that (missed it with the other NULL
check cargo-culting).

>> +	for (i = 0; i < cmdline->nr; i++)
>> +		free((char *)cmdline->rev[i].name);
>> +	free(cmdline->rev);
>
> This could just be in release_revisions()

Ditto <[email-masked]>. I.e. I'd prefer to
keep these for readability