This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix gensupport.c memory leak (take 3)



On Mar 16, 2006, at 5:58 PM, Roger Sayle wrote:


+ /* predicable_true and predicable_false are only ever set in this
+ function, which ensures that we need to free only predicable_false
+ to avoid memory leaks. */
+ if (predicable_false)
+ free ((void*) predicable_false);

You really don't need the if here as free handles NULL pointers just fine.


-- Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]