Skip to contentSkip to conversation

btrfs: free cluster before exit

PATCH New Alexander Beregalov 1 participant 1 message Jan 7, 2010 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: free cluster before exit

Fix possible memory leak.

---
 fs/btrfs/relocation.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
fs/btrfs/relocation.c +3 -1
index a972868..ed3e4a2 100644
@@ -3281,8 +3281,10 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc)
 		return -ENOMEM;
 
 	path = btrfs_alloc_path();
-	if (!path)
+	if (!path) {
+		kfree(cluster);
 		return -ENOMEM;
+	}
 
 	rc->extents_found = 0;
 	rc->extents_skipped = 0;
Signature · 1 line
1.6.6