diff options
author | David Sterba <dsterba@suse.cz> | 2014-12-30 14:52:55 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2014-12-30 15:48:54 +0100 |
commit | 0665aaf5a3733c5153e7fc0959d813c6ff76ee34 (patch) | |
tree | bfe1f22f03c032d8d62706f0e1738b4ddfc6fad7 /cmds-check.c | |
parent | d4ef1a06f8be623ae94e4d498c306e8dd1605bef (diff) |
btrfs-progs: check, fix path leak in error branch
Resolves-coverity-id: 1260250
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-check.c')
-rw-r--r-- | cmds-check.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cmds-check.c b/cmds-check.c index e74b116c..71e4f4f3 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -2839,7 +2839,7 @@ static int repair_btree(struct btrfs_root *root, ret = PTR_ERR(trans); fprintf(stderr, "Error starting transaction: %s\n", strerror(-ret)); - return ret; + goto out_free_path; } cache = first_cache_extent(corrupt_blocks); while (cache) { @@ -2894,8 +2894,9 @@ static int repair_btree(struct btrfs_root *root, cache = next_cache_extent(cache); } out: - btrfs_free_path(path); btrfs_commit_transaction(trans, root); +out_free_path: + btrfs_free_path(path); return ret; } |