akpm at linux-foundation.org
2013-Aug-27 21:05 UTC
[Ocfs2-devel] [patch 18/22] ocfs2: free path in ocfs2_remove_inode_range()
From: Younger Liu <younger.liu at huawei.com> Subject: ocfs2: free path in ocfs2_remove_inode_range() In ocfs2_remove_inode_range(), there is a memory leak. The variable path has allocated memory with ocfs2_new_path_from_et(), but it is not free. Signed-off-by: Younger Liu <younger.liu at huawei.com> Reviewed-by: Jie Liu <jeff.liu at oracle.com> Cc: Mark Fasheh <mfasheh at suse.com> Cc: Joel Becker <jlbec at evilplan.org> Signed-off-by: Andrew Morton <akpm at linux-foundation.org> --- fs/ocfs2/file.c | 1 + 1 file changed, 1 insertion(+) diff -puN fs/ocfs2/file.c~ocfs2-free-path-in-ocfs2_remove_inode_range fs/ocfs2/file.c --- a/fs/ocfs2/file.c~ocfs2-free-path-in-ocfs2_remove_inode_range +++ a/fs/ocfs2/file.c @@ -1815,6 +1815,7 @@ static int ocfs2_remove_inode_range(stru ocfs2_truncate_cluster_pages(inode, byte_start, byte_len); out: + ocfs2_free_path(path); ocfs2_schedule_truncate_log_flush(osb, 1); ocfs2_run_deallocs(osb, &dealloc); _