diff options
author | Zach Brown <zab@redhat.com> | 2013-10-07 14:43:01 -0700 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-10-16 08:23:13 -0400 |
commit | 7dff2d3a1f54fe4f519aa804f1935d02fafa5a3e (patch) | |
tree | 82a9cf977e0d492677ca7fc1cb7e6b641a8178bf /cmds-check.c | |
parent | 0b8cea12ffcdb919e5745664d7a88bb67d3758d2 (diff) |
btrfs-progs: don't leak path in verify_space_cache
This was found by static analysis.
Signed-off-by: Zach Brown <zab@redhat.com>
Reviewed-by: chandan <chandan@linux.vnet.ibm.com
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'cmds-check.c')
-rw-r--r-- | cmds-check.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmds-check.c b/cmds-check.c index d3535717..668af158 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -3294,13 +3294,13 @@ static int verify_space_cache(struct btrfs_root *root, ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); if (ret < 0) - return ret; + goto out; ret = 0; while (1) { if (path->slots[0] >= btrfs_header_nritems(path->nodes[0])) { ret = btrfs_next_leaf(root, path); if (ret < 0) - return ret; + goto out; if (ret > 0) { ret = 0; break; @@ -3340,6 +3340,8 @@ static int verify_space_cache(struct btrfs_root *root, ret = check_cache_range(root, cache, last, cache->key.objectid + cache->key.offset - last); + +out: btrfs_free_path(path); if (!ret && |