From: Richard Jones Date: Sat, 9 May 2009 12:31:08 +0000 (+0100) Subject: Fix four memory leaks in guestfs.c revealed by valgrind. X-Git-Tag: 1.0.22~3 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;ds=sidebyside;h=09492abb6590c8b804273172dc5340705a868f95;p=libguestfs.git Fix four memory leaks in guestfs.c revealed by valgrind. --- 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). */