From: David Sterba Date: Tue, 30 Dec 2014 13:52:55 +0000 (+0100) Subject: btrfs-progs: check, fix path leak in error branch X-Git-Tag: upstream/4.16.1~2491 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0665aaf5a3733c5153e7fc0959d813c6ff76ee34;p=platform%2Fupstream%2Fbtrfs-progs.git btrfs-progs: check, fix path leak in error branch Resolves-coverity-id: 1260250 Signed-off-by: David Sterba --- diff --git a/cmds-check.c b/cmds-check.c index e74b116..71e4f4f 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; }