Re: [PATCH] merge-ort: fix calling merge_finalize() with no intermediate merge

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

 



Derrick Stolee <derrickstolee@xxxxxxxxxx> writes:

> On 4/20/2023 3:14 AM, Elijah Newren via GitGitGadget wrote:
>> From: Elijah Newren <newren@xxxxxxxxx>
>
>> While at it, ensure the FREE_AND_NULL() in the function does something
>> useful with the nulling aspect, namely sets result->priv to NULL rather
>> than a mere temporary.
>
> Good call. It also makes the code look better.

And more correct, if the NULLness of result->priv matters.

> Perhaps this would be better as
>
> 	if (result->priv) {
> 		clear_or_reinit_internal_opts(result->priv, 0);
> 		FREE_AND_NULL(result->priv);
> 	}
>
> to avoid an accidental addition of code to the end of this
> method that doesn't depend on result->priv?

It does sound like a good idea.

Thanks.



[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