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] c-common.c: Fix memory leak.


Kazu Hirata wrote:
Hi,

Attached is a patch to fix memory leak.

Consider the "if" statement shown in the patch.  If we are returning
cstr.txt, nobody will ever reference namep, which is allocated via
XVECNEW a few lines up.
^^^^^^^

The patch solves this problem by freeing namep with XDELETEVEC.
                                                      ^^^^^^^^^^
is it really the case that our new shiny C++-safe macros are so
inconsistently named?

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk


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