Skip to contentSkip to conversation

Fix memory leak in xenconsoled

PATCH In review Anthony Liguori 1 participant 1 message Nov 1, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 Fix memory leak in xenconsoled

# HG changeset patch
# User Anthony Liguori <[email protected]>
# Node ID 6de1d7b66c8a52ac6420f35aac03fe219caf87a3
# Parent ea6d9f29dff5d429c0a7cb6c381628e6f2bb38e1 Fix memory leak in domain cleanup spotted by doremifa in #xen.

tools/console/daemon/io.c +13 -4
diff -r ea6d9f29dff5 -r 6de1d7b66c8a tools/console/daemon/io.c
@@ -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
[email protected]
http://lists.xensource.com/xen-devel