From 09492abb6590c8b804273172dc5340705a868f95 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Sat, 9 May 2009 13:31:08 +0100 Subject: [PATCH] Fix four memory leaks in guestfs.c revealed by valgrind. --- src/guestfs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/guestfs.c b/src/guestfs.c index be7b0c7..9fd943f 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -308,6 +308,8 @@ guestfs_close (guestfs_h *g) } /* release mutex (XXX) */ + free (g->msg_in); + free (g->msg_out); free (g->last_error); free (g); } @@ -824,6 +826,11 @@ guestfs_launch (guestfs_h *g) /* Parent (library). */ g->pid = r; + free (kernel); + kernel = NULL; + free (initrd); + initrd = NULL; + /* Fork the recovery process off which will kill qemu if the parent * process fails to do so (eg. if the parent segfaults). */ -- 1.8.3.1