This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] unfreed memory in cli_command_loop
- From: "Michael Snyder" <msnyder at sonic dot net>
- To: "Daniel Jacobowitz" <drow at false dot org>
- Cc: <gdb-patches at sourceware dot org>
- Date: Sun, 1 Jul 2007 08:50:25 -0700
- Subject: Re: [patch] unfreed memory in cli_command_loop
- References: <18552.12.7.175.2.1183082732.squirrel@webmail.sonic.net> <20070701153828.GB10872@caradoc.them.org>
- Reply-to: "Michael Snyder" <msnyder at sonic dot net>
> On Thu, Jun 28, 2007 at 07:05:32PM -0700, Michael Snyder wrote:
> > Minor memory leak. I checked to make sure that readline makes
> > and keeps its own copy of this string, so it's OK for us to
> > free our copy.
>
> Seems fine, but I'm not really sure when that cleanup is going to be
> called. We're outside the command loop here so it hasn't recorded a
> watermark to clean back to. Does it ever get run? If not, you could
> use alloca and avoid the whole issue.
Whoa, you're right, thanks for the catch.