xfs
[Top] [All Lists]

[PATCH 1/2] xfsprogs: fix leak in xfs_log_recover_add_to_trans

To: xfs@xxxxxxxxxxx
Subject: [PATCH 1/2] xfsprogs: fix leak in xfs_log_recover_add_to_trans
From: tinguely@xxxxxxx
Date: Sat, 05 Oct 2013 21:51:52 -0500
Delivered-to: xfs@xxxxxxxxxxx
References: <20131006025151.573856006@xxxxxxx>
User-agent: quilt/0.51-1
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@xxxxxxx>

---
Found by Coverity (134683).

 libxlog/xfs_log_recover.c |    1 +
 1 file changed, 1 insertion(+)

Index: b/libxlog/xfs_log_recover.c
===================================================================
--- 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);
                }
 


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