Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 105d736c57b2691635bd047efe146ef0 > files > 12

btrfs-progs-0.20-0.rc1.20130117.2.mga3.src.rpm

From 4b76e34093162945e8404e4e6b6754ce35ca3ce5 Mon Sep 17 00:00:00 2001
From: Zach Brown <zab@redhat.com>
Date: Mon, 21 Jan 2013 16:34:03 -0800
Subject: [PATCH] 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>
---
 restore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/restore.c b/restore.c
index 4853203..3fa8769 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);
-- 
1.8.1.5