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

[Cluster-devel] [PATCH 3/5] 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.\n"),
 			     (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


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