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: Daniel Jacobowitz <drow at false dot org>
- To: msnyder at sonic dot net
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 1 Jul 2007 11:38:28 -0400
- Subject: Re: [patch] unfreed memory in cli_command_loop
- References: <18552.12.7.175.2.1183082732.squirrel@webmail.sonic.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.
--
Daniel Jacobowitz
CodeSourcery