This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [Patch] More responsive QUITs
On Mon, Jul 25, 2011 at 1:41 PM, Tom Tromey <tromey@redhat.com> wrote:
> Sterling> New revision of the patch which addresses this issue attached.
>
> You forgot to CC the list :)
>
> Sterling> + ?struct cleanup *back_to;
>
> Sterling> ? ?list[0] = NULL;
>
> Sterling> ? ?if (!have_full_symbols () && !have_partial_symbols ())
> Sterling> ? ? ?return list;
>
> Sterling> + ?back_to = make_cleanup (xfree, list);
>
> This captures 'list' at this point in time, but list can be reallocated.
> See add_filename_to_list.
Will work on a fix for this.
> Also, each element of list is itself mallocd and so must be freed.
The calling function (completer.c:308 and below) doesn't free the
individual elements either, so there is a more general gdb leak. I'll
fix both.
Sterling