WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 1/3] Fix memory leak in xenconsoled

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 1/3] Fix memory leak in xenconsoled
From: Anthony Liguori <aliguori@xxxxxxxxxx>
Date: Tue, 01 Nov 2005 13:09:11 -0600
Delivery-date: Tue, 01 Nov 2005 19:06:33 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051013)

# HG changeset patch
# User Anthony Liguori <anthony@xxxxxxxxxxxxx>
# Node ID 6de1d7b66c8a52ac6420f35aac03fe219caf87a3
# Parent  ea6d9f29dff5d429c0a7cb6c381628e6f2bb38e1
Fix memory leak in domain cleanup spotted by doremifa in #xen.

Signed-off-by: Anthony Liguori <aliguori@xxxxxxxxxx>

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);
 }
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 1/3] Fix memory leak in xenconsoled, Anthony Liguori <=