public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: free cluster before exit
@ 2010-01-07  2:03 Alexander Beregalov
  0 siblings, 0 replies; only message in thread
From: Alexander Beregalov @ 2010-01-07  2:03 UTC (permalink / raw)
  To: chris.mason; +Cc: linux-btrfs, Alexander Beregalov

Fix possible memory leak.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
---
 fs/btrfs/relocation.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index a972868..ed3e4a2 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -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;
-- 
1.6.6


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-01-07  2:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-07  2:03 [PATCH] btrfs: free cluster before exit Alexander Beregalov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox