Re: [PATCH 2/7] reset: free instead of leaking unneeded ref

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

 



On Mon, Mar 08, 2021 at 06:36:15PM +0000, Andrzej Hunt via GitGitGadget wrote:

> dwim_ref() allocs a new string into ref. Instead of setting to NULL to discard
> it, we can FREE_AND_NULL.
> [...]
>  			dwim_ref(rev, strlen(rev), &dummy, &ref, 0);
>  			if (ref && !starts_with(ref, "refs/"))
> -				ref = NULL;
> +				FREE_AND_NULL(ref);

Yeah, this seems like a perfect solution for this case.

-Peff



[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