btrfs-progs: don't free null path

btrfs_free_path() derefs the path before freeing it.  It can't be passed
a null pointer when allocation fails.

Signed-off-by: Zach Brown <zab@redhat.com>
master
Zach Brown 2013-01-21 16:34:03 -08:00
parent 5fc2413e64
commit 4b76e34093
1 changed files with 1 additions and 1 deletions

View File

@ -710,7 +710,7 @@ static int find_first_dir(struct btrfs_root *root, u64 *objectid)
path = btrfs_alloc_path();
if (!path) {
fprintf(stderr, "Ran out of memory\n");
goto out;
return ret;
}
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);