From f766c19a6779af4b96770df18c8f335a6ffd5ebf Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 24 Nov 2011 15:49:27 +0000 Subject: [PATCH] filesystems: Fix memory leak found by valgrind. (cherry picked from commit cd3d28491dd19d25a6c04a8bc6a7ec94bded413b) --- cat/virt-filesystems.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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]); } -- 1.8.3.1