[PATCH] xfs: fix memory leak in xlog_recover_add_to_trans

tinguely
2013-09-27T14:02:09Z

[-- Attachment #1: xfs-fix-leak-in-xlog_recover_add_to_trans.patch --]
[-- Type: text/plain, Size: 814 bytes --]

Free the memory in error path of xlog_recover_add_to_trans().
Normally this memory is freed in recovery pass2, but is leaked
in the error path.

Signed-off-by: Mark Tinguely <tinguely@sgi.com>
---
Found by Coverity (134683) in userspace, same patch applies there
also.
fs/xfs/xfs_log_recover.c | 1 +
1 file changed, 1 insertion(+)

Index: b/fs/xfs/xfs_log_recover.c
===================================================================
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -1585,6 +1585,7 @@ xlog_recover_add_to_trans(
"bad number of regions (%d) in inode log format",
in_f->ilf_size);
ASSERT(0);
+ free(ptr);
return XFS_ERROR(EIO);
}