[patch] unfreed memory in cli_command_loop

Daniel Jacobowitz drow@false.org
Sun Jul 1 15:39:00 GMT 2007


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



More information about the Gdb-patches mailing list