[cfe-dev] Code tautology for checking pointer for not null before calling free

William King william.king at quentustech.com
Mon Apr 28 16:43:23 PDT 2014


Attached is a simple C program that has an unnecessary if check on a
pointer before calling free() on it.

Any chance someone could add this as a code reduction warning? I've
recently seen several projects that unnecessarily wrap free() with an
if() check.
-- 
William King
Senior Engineer
Quentus Technologies, INC
1037 NE 65th St Suite 273
Seattle, WA 98115
Main:   (877) 211-9337
Office: (206) 388-4772
Cell:   (253) 686-5518
william.king at quentustech.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ifnotfree.c
Type: text/x-csrc
Size: 190 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140428/32e994ff/attachment.c>


More information about the cfe-dev mailing list