Patchwork [07/11] e4defrag: Fix memory leak in file_defrag()

login
register
mail settings
Submitter Kazuya Mio
Date April 8, 2011, 7:52 a.m.
Message ID <4D9EBEC7.5070504@sx.jp.nec.com>
Download mbox | patch
Permalink /patch/90290/
State Superseded
Headers show

Comments

Kazuya Mio - April 8, 2011, 7:52 a.m.
'donor_list' is allocated in get_file_extents(), but it's not freed.
This patch fixes it.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
---
 misc/e4defrag.c |    1 +
 1 file changed, 1 insertion(+)
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/misc/e4defrag.c b/misc/e4defrag.c
index f4ced9a..ba0d424 100644
--- a/misc/e4defrag.c
+++ b/misc/e4defrag.c
@@ -1191,6 +1191,7 @@  out:
 	if (donor_fd != -1)
 		close(donor_fd);
 	free_ext(orig_list);
+	free_ext(donor_list);
 	free_exts_group(orig_group_head);
 	return 0;
 }