xfs
[Top] [All Lists]

[PATCH 04/14] xfsprogs: fix memory leak in xlog_recover_add_to_trans

To: xfs@xxxxxxxxxxx
Subject: [PATCH 04/14] xfsprogs: fix memory leak in xlog_recover_add_to_trans
From: Eric Sandeen <sandeen@xxxxxxxxxx>
Date: Tue, 8 Apr 2014 18:24:54 -0500
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1396999504-13769-1-git-send-email-sandeen@xxxxxxxxxx>
References: <1396999504-13769-1-git-send-email-sandeen@xxxxxxxxxx>
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.

Userspace version of kernel commits 519ccb8 & aaaae98

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---
 libxlog/xfs_log_recover.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/libxlog/xfs_log_recover.c b/libxlog/xfs_log_recover.c
index 3f22921..d1fa535 100644
--- a/libxlog/xfs_log_recover.c
+++ b/libxlog/xfs_log_recover.c
@@ -1131,6 +1131,7 @@ xlog_recover_add_to_trans(
                "bad number of regions (%d) in inode log format",
                                  in_f->ilf_size);
                        ASSERT(0);
+                       kmem_free(ptr);
                        return XFS_ERROR(EIO);
                }
 
-- 
1.7.1

<Prev in Thread] Current Thread [Next in Thread>