Re: [PATCH] prefix_path(): Unconditionally free result of prefix_path

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

 



Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes:

> On Mon, May 4, 2015 at 3:11 PM, Stefan Beller <sbeller@xxxxxxxxxx> wrote:
>> prefix_path(): Unconditionally free result of prefix_path
>
> Slightly redundant mention of "prefix_path". Also, prevailing custom
> is to drop capitalization.
>
>> prefix_path() always returns a newly allocated string since
>> d089eba (setup: sanitize absolute and funny paths in get_pathspec(),
>> 2008-01-28)
>
> I'd probably turn this sentence fragment into a proper sentence:
>
>     As of d089eba (...), prefix_path() always returns a newly
>     allocated string, so free its result unconditionally.
>
>> Additionally the const is dropped from the pointers, so the call to
>> free doesn't need a cast.
>
> Imperative mood:
>
>     Additionally, drop the const from variables to which the
>     prefix_path() result is assigned so they can be free()'d
>     without having to cast-away constness.
>
>> Signed-off-by: Stefan Beller <sbeller@xxxxxxxxxx>
>> ---
>>
>> Notes:
>>     Thanks for all the suggestions!
>>     They are incorporated into this version of the patch.
>
> Thanks, this version looks much better.
>
> FWIW, with or without addressing the very minor nits above:
>
> Reviewed-by: Eric Sunshine <sunshine@xxxxxxxxxxxxxx>

Thanks, both.

To save a round-trip, I'll munge the log message myself stealing
Eric's suggestions.


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]