[PATCH 08/16] btrfs-progs: fix resource leak in scrub_start()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In the "nothing to resume" case we return directly and leak
several bits of memory; goto out to free them properly.

Resolves-Coverity-CID: 1125934
Resolves-Coverity-CID: 1125935
Resolves-Coverity-CID: 1125936
Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---
 cmds-scrub.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/cmds-scrub.c b/cmds-scrub.c
index 605af45..5f3eade 100644
--- a/cmds-scrub.c
+++ b/cmds-scrub.c
@@ -1261,7 +1261,8 @@ static int scrub_start(int argc, char **argv, int resume)
 		if (!do_quiet)
 			printf("scrub: nothing to resume for %s, fsid %s\n",
 			       path, fsid);
-		return 2;
+		err = 2;
+		goto out;
 	}
 
 	ret = prg_fd = socket(AF_UNIX, SOCK_STREAM, 0);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux