From: Richard W.M. Jones Date: Thu, 24 Nov 2011 15:49:27 +0000 (+0000) Subject: filesystems: Fix memory leak found by valgrind. X-Git-Tag: 1.15.6~9 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=cd3d28491dd19d25a6c04a8bc6a7ec94bded413b;p=libguestfs.git filesystems: Fix memory leak found by valgrind. --- diff --git a/cat/virt-filesystems.c b/cat/virt-filesystems.c index de7a243..ac6466f 100644 --- a/cat/virt-filesystems.c +++ b/cat/virt-filesystems.c @@ -449,7 +449,7 @@ do_output_filesystems (void) /* Skip swap and unknown, unless --extra flag was given. */ if (!(output & OUTPUT_FILESYSTEMS_EXTRA) && (STREQ (fses[i+1], "swap") || STREQ (fses[i+1], "unknown"))) - continue; + goto next; dev = canonical_device (fses[i]); @@ -492,6 +492,8 @@ do_output_filesystems (void) free (dev); free (vfs_label); free (vfs_uuid); + + next: free (fses[i]); free (fses[i+1]); }