[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Fix memory leak in domain cleanup spotted by doremifa in #xen.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 4ec05d64f202098695329880cd2d25514add6c03
# Parent  89030fab2c3fd094f4256b48c370110c19068f5b
Fix memory leak in domain cleanup spotted by doremifa in #xen.

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

diff -r 89030fab2c3f -r 4ec05d64f202 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Wed Nov  2 10:21:46 2005
+++ b/tools/console/daemon/io.c Wed Nov  2 10:24:49 2005
@@ -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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.