This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] cplus-demangler, free resource after a failed call to gnu_special.
- From: Ian Lance Taylor <iant at google dot com>
- To: Andrew Burgess <aburgess at broadcom dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>, gdb-patches at sourceware dot org
- Date: Fri, 9 May 2014 13:53:44 -0700
- Subject: Re: [PATCH] cplus-demangler, free resource after a failed call to gnu_special.
- Authentication-results: sourceware.org; auth=none
- References: <1399646123-9960-1-git-send-email-aburgess at broadcom dot com>
On Fri, May 9, 2014 at 7:35 AM, Andrew Burgess <aburgess@broadcom.com> wrote:
> if ((AUTO_DEMANGLING || GNU_DEMANGLING))
> {
> success = gnu_special (work, &mangled, &decl);
> + if (!success)
> + {
> + delete_work_stuff (work);
> + string_delete (&decl);
> + }
As far as I can see, decl may be uninitialized at this point. I don't
think you can call string_delete. You need to ensure that decl is
initialized somehow.
Ian