Re: [PATCH] Remove useless if-before-free tests.

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

 



On Feb 17, 2008 1:58 PM, Jim Meyering <jim@xxxxxxxxxxxx> wrote:
> This change removes all useless if-before-free tests.
> E.g., it replace code like this
>
>         if (some_expression)
>                 free (some_expression);
>
> with the now-equivalent
>
>         free (some_expression);
>
> It is equivalent not just because POSIX has required free(NULL)
> to work for a long time, but simply because it has worked for
> so long that no reasonable porting target fails the test.
> Here's some evidence from nearly 1.5 years ago:
>
>     http://www.winehq.org/pipermail/wine-patches/2006-October/031544.html

That's not great evidence. It only tests 9 systems, and misses several
targets that Git already runs on. It seems like a fairly minor cleanup
for a definite loss of portability.

It's also somewhat useful for indicating that the particular pointer
*might* be NULL.


Dave.
-
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]

  Powered by Linux