[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH 7/8] 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.\n"), err);
+				free(buf);
 				goto fail;
 			}
 			/* call gfs2_inum_range_in() to retrieve range */
-- 
1.7.6.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]