Re: [PATCH v4 01/14] config: clarify memory ownership when preparing comment strings

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

 



On Fri, May 3, 2024, at 11:56, Patrick Steinhardt wrote:
> The ownership of memory returned when preparing a comment string is
> quite intricate: when the returned value is different than the passed
> value, then the caller is responsible to free the memory. This is quite
> subtle, and it's even easier to miss because the returned value is in
> fact a `const char *`.
>
> Adapt the function to always return either `NULL` or a newly allocated
> string. The function is called at most once per git-config(1), so it's
> not like this micro-optimization really matters. Thus, callers are now
> always responsible for freeing the value.
> ---

Missing a signoff on this one. The only one in the series.

-- 
Kristoffer Haugsbakk




[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