Linux Archive

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

Andrew Price 01-11-2012 05:21 PM

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

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

diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index a1f99d6..bab61c1 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -688,6 +688,7 @@ static int init_system_inodes(struct gfs2_sbd *sdp)
if (err != sdp->md.statfs->i_di.di_size) {
log_crit(_("Error %d reading statfs file. "
"Aborting.
"), err);
+ free(buf);
goto fail;
}
/* call gfs2_inum_range_in() to retrieve range */
--
1.7.6.5


All times are GMT. The time now is 01:09 PM.

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