From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: [PATCH 1/3] Fix memory leak in xenconsoled Date: Tue, 01 Nov 2005 13:09:11 -0600 Message-ID: <4367BD57.5070609@us.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040007020304050508070805" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------040007020304050508070805 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit --------------040007020304050508070805 Content-Type: text/plain; name="7573-xenconsole.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="7573-xenconsole.diff" # HG changeset patch # User Anthony Liguori # Node ID 6de1d7b66c8a52ac6420f35aac03fe219caf87a3 # Parent ea6d9f29dff5d429c0a7cb6c381628e6f2bb38e1 Fix memory leak in domain cleanup spotted by doremifa in #xen. Signed-off-by: Anthony Liguori diff -r ea6d9f29dff5 -r 6de1d7b66c8a tools/console/daemon/io.c --- a/tools/console/daemon/io.c Mon Oct 31 17:07:14 2005 +0100 +++ b/tools/console/daemon/io.c Tue Nov 1 11:08:31 2005 -0500 @@ -380,12 +380,21 @@ if (!buffer_empty(&d->buffer)) return; - if (d->buffer.data) + if (d->buffer.data) { free(d->buffer.data); - d->buffer.data = NULL; - if (d->tty_fd != -1) + d->buffer.data = NULL; + } + + if (d->tty_fd != -1) { close(d->tty_fd); - d->tty_fd = -1; + d->tty_fd = -1; + } + + if (d->conspath) { + free(d->conspath); + d->conspath = NULL; + } + remove_domain(d); } --------------040007020304050508070805 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------040007020304050508070805--