Re: [PATCH v2 06/27] revision.[ch]: provide and start using a release_revisions()

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

 



On Wed, Mar 23 2022, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason  <avarab@xxxxxxxxx> writes:
>
>> diff --git a/revision.c b/revision.c
>> index 303d1188207..90bac9ada03 100644
>> --- a/revision.c
>> +++ b/revision.c
>> @@ -2933,6 +2933,13 @@ static void release_revisions_commit_list(struct rev_info *revs)
>>  	revs->commits = NULL;
>>  }
>>  
>> +void release_revisions(struct rev_info *revs)
>> +{
>> +	if (!revs)
>> +		return;
>> +	object_array_clear(&revs->pending);
>> +}
>
> Yay.
>
> It is unclear why we want to allow passing NULL to this, though.  Do
> we even have any code paths that allocate on-heap rev-info?  Address
> of an on-stack or global rev_info will never be NULL.

I'm almost certain it's boilerplate from early testing, and running the
tests with it removed just now passed.

I'll make a bit more sure sure it's OK (with SANITIZE=address et al) and
drop it in a v3.




[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