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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <220403.86ilrqmflb.gmgdl@xxxxxxxxxxxxxxxxxxx>. I.e. I'd prefer to
keep these for readability




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux