summaryrefslogtreecommitdiff
path: root/restore.c
diff options
context:
space:
mode:
authorZach Brown <zab@redhat.com>2013-01-21 16:34:03 -0800
committerZach Brown <zab@redhat.com>2013-02-05 16:09:39 -0800
commit4b76e34093162945e8404e4e6b6754ce35ca3ce5 (patch)
tree333272d6ea4581f2335f10311ab5265cfbabdfe5 /restore.c
parent5fc2413e64b36202f7a020bc69d4a30186145dd0 (diff)
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>
Diffstat (limited to 'restore.c')
-rw-r--r--restore.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/restore.c b/restore.c
index 4853203c..3fa87692 100644
--- a/restore.c
+++ b/restore.c
@@ -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);