This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix gensupport.c memory leak (take 3)
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Steve Ellcey <sje at cup dot hp dot com>
- Date: Thu, 16 Mar 2006 18:56:18 -0500
- Subject: Re: [PATCH] Fix gensupport.c memory leak (take 3)
- References: <Pine.LNX.4.44.0603161546590.32179-100000@www.eyesopen.com>
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