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.14.4~7 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=f766c19a6779af4b96770df18c8f335a6ffd5ebf;p=libguestfs.git filesystems: Fix memory leak found by valgrind. (cherry picked from commit cd3d28491dd19d25a6c04a8bc6a7ec94bded413b) --- 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]); }