[RFA] Fix two memory leaks

Joel Brobecker brobecker@adacore.com
Tue Oct 23 22:02:00 GMT 2012


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



More information about the Gdb-patches mailing list