Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Cluster Development (http://www.linux-archive.org/cluster-development/)
-   -   gfs2_edit: Fix memory leak in find_journal_block (http://www.linux-archive.org/cluster-development/617997-gfs2_edit-fix-memory-leak-find_journal_block.html)

Andrew Price 01-06-2012 02:19 PM

gfs2_edit: Fix memory leak in find_journal_block
 
Spotted by coverity: Variable "jiinode" going out of scope leaks the
storage it points to.

Signed-off-by: Andrew Price <anprice@redhat.com>
---
gfs2/edit/hexedit.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 1deb374..f58657b 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -1521,6 +1521,7 @@ static uint64_t find_journal_block(const char *journal, uint64_t *j_size)
jblock = ji.ji_addr;
*j_size = ji.ji_nsegment * 0x10;
}
+ inode_put(&jiinode);
} else {
struct gfs2_dinode jdi;

--
1.7.6.4


All times are GMT. The time now is 08:12 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.