Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Cluster Development (http://www.linux-archive.org/cluster-development/)
-   -   fsck.gfs2: Plug a leak in find_block_ref() (http://www.linux-archive.org/cluster-development/622362-fsck-gfs2-plug-leak-find_block_ref.html)

Andrew Price 01-18-2012 03:39 PM

fsck.gfs2: Plug a leak in find_block_ref()
 
Spotted by coverity: Variable "ip" going out of scope leaks the storage
it points to.

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

diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index ae6d45c..9e6f376 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -344,6 +344,7 @@ static int find_block_ref(struct gfs2_sbd *sdp, uint64_t inode)
log_debug( _("Block %lld (0x%llx) is not gfs2 metadata.
"),
(unsigned long long)inode,
(unsigned long long)inode);
+ fsck_inode_put(&ip);
return 1;
}
/* Check to see if this inode was referenced by another by mistake */
--
1.7.7.5


All times are GMT. The time now is 11:12 AM.

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