From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeX44-0007SI-La for qemu-devel@nongnu.org; Tue, 12 Jun 2012 15:47:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SeX42-0004Kf-LN for qemu-devel@nongnu.org; Tue, 12 Jun 2012 15:47:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61763) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeX42-0004Ka-DE for qemu-devel@nongnu.org; Tue, 12 Jun 2012 15:47:42 -0400 Date: Tue, 12 Jun 2012 16:42:39 -0300 From: Luiz Capitulino Message-ID: <20120612164239.4be3d0f2@doriath.home> In-Reply-To: <4FD3C1DA.9000304@weilnetz.de> References: <1337024840-28273-1-git-send-email-sw@weilnetz.de> <4FBBF5F6.7010204@weilnetz.de> <4FD3C1DA.9000304@weilnetz.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1.1] monitor: Fix memory leak with readline completion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Anthony Liguori , qemu-devel@nongnu.org On Sat, 09 Jun 2012 23:36:26 +0200 Stefan Weil wrote: > Am 22.05.2012 22:24, schrieb Stefan Weil: > > Am 14.05.2012 21:47, schrieb Stefan Weil: > >> Each string which is shown during readline completion in the QEMU > >> monitor > >> is allocated dynamically but currently never deallocated. > >> > >> Add the missing loop which calls g_free for the allocated strings. > >> > >> Signed-off-by: Stefan Weil > >> --- > >> readline.c | 3 +++ > >> 1 file changed, 3 insertions(+) > >> > >> diff --git a/readline.c b/readline.c > >> index a6c0039..646b6e8 100644 > >> --- a/readline.c > >> +++ b/readline.c > >> @@ -337,6 +337,9 @@ static void readline_completion(ReadLineState *rs) > >> } > >> readline_show_prompt(rs); > >> } > >> + for (i = 0; i< rs->nb_completions; i++) { > >> + g_free(rs->completions[i]); > >> + } > >> } > >> > >> /* return true if command handled */ > > > > Ping? > > > > This patch is for QEMU 1.1, but was not committed up to now. > > > > Regards, > > Stefan Weil > > > > > Ping^2? Should I send a pull request? > The patch is available at http://patchwork.ozlabs.org/patch/159139/. Applied to the qmp branch, thanks.