This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Fix two memory leaks
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: "gdb-patches at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Tue, 23 Oct 2012 18:02:36 -0400
- Subject: Re: [RFA] Fix two memory leaks
- References: <50870A74.80903@redhat.com>
Hi Keith,
Tsk, tsk, tsk - can we have two separate patches, please? :-)
Seriously, it does make it easier if we have unexpected regressions...
> ChangeLog
> 2012-10-23 Keith Seitz <keiths@redhat.com>
>
> * breakpoint.c (clear_command): Add cleanup for
> sals.sals if an argument is given.
This one looks good to me. But I'm wonderin if we shouldn't also
document the fact that decode_line_with_current_source returns
a structure that contains newly allocated memory?
> * linespec.c (parse_linespec): Do cleanups after
> parsing a convenience variable.
This one looks good to me too.
You might want to wait for a day or two before checking in, as these
files are not within my area of expertise. But I verified that the
memory is allocated on the heap, and leaked if not free'ed.
Cheers,
--
Joel