From 70607997eeb24017196602afec4f1f0693a57a74 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Sat, 3 Jan 2015 03:33:31 +0100 Subject: [PATCH] btrfs-progs: fix leak of path in reset_balance A path may leak after an unlikely error condition. Resolves-coverity-id: 1199474 Signed-off-by: David Sterba --- cmds-check.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmds-check.c b/cmds-check.c index 6c87d1a4..dabe87a5 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -7772,7 +7772,8 @@ reinit_data_reloc: root = btrfs_read_fs_root(fs_info, &key); if (IS_ERR(root)) { fprintf(stderr, "Error reading data reloc tree\n"); - return PTR_ERR(root); + ret = PTR_ERR(root); + goto out; } record_root_in_trans(trans, root); ret = btrfs_fsck_reinit_root(trans, root, 0);