This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Stop leaking extra_string
- From: Keith Seitz <keiths at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: "gdb-patches at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Wed, 20 Mar 2013 15:17:51 -0700
- Subject: Re: [RFA] Stop leaking extra_string
- References: <514A08A5 dot 6020504 at redhat dot com> <514A0A9E dot 1090105 at redhat dot com>
On 03/20/2013 12:14 PM, Pedro Alves wrote:
When we get to this bit in addr_string_to_sals (called through
breakpoint_re_set_default):
if (cond_string)
b->cond_string = cond_string;
b->thread = thread;
b->task = task;
if (extra_string)
b->extra_string = extra_string;
b->condition_not_parsed = 0;
Is b->extra_string always NULL here, or could we be
leaking it here too?
I don't think that is possible right now.
When extra_string is set by find_condition_and_thread,
init_breakpoint_sal (called from ops->create_breakpoints_sal) will error
if extra_string isn't NULL (for non-dprintf breakpoints).
So the only way to get extra_string != NULL in breakpoint_re_set is by
setting a pending dprintf breakpoint, which doesn't even work because
any pending breakpoint will automatically have extra_string set to NULL
in create_breakpoint.
But this is all largely academic for two reasons: 1) Adding an xfree
there wouldn't hurt; 2) I'm going to submit a patch to do just that
because I am changing it so that extra_string could be set. :-)
I've committed my original patch. Thank you for taking a look at this.
Keith