All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Fix memory leak in xenconsoled
@ 2005-11-01 19:09 Anthony Liguori
  0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2005-11-01 19:09 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 7573-xenconsole.diff --]
[-- Type: text/plain, Size: 882 bytes --]

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

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

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);
 }
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-11-01 19:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-01 19:09 [PATCH 1/3] Fix memory leak in xenconsoled Anthony Liguori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.