fsck.gfs2: Fix a potential memory leak in pass3
PATCH 1/2 fsck.gfs2: Fix a potential memory leak in pass3
Coverity spotted an instance where pass3() breaks out of the loop without first freeing the inode.
Signed-off-by Andrew Price <[email protected]>
--- gfs2/fsck/pass3.c | 1 + 1 file changed, 1 insertion(+)
gfs2/fsck/pass3.c +1 -0
@@ -267,6 +267,7 @@ int pass3(struct gfs2_sbd *sdp) " (y/n) "))) {log_err (_ ("The block was not " "cleared\n" )); +fsck_inode_put (&ip);break ; } log_warn( _("inode %lld (0x%llx) is now "
Signature · 1 line
2.4.11
PATCH 2/2 gfs2_edit savemeta: Fix use of uninitialized 'blk'
Fixes
"savemeta.c:737:14: warning: ?blk? may be used uninitialized in this function"
blk is never actually used uninitialized here but the compiler can't reason it out, so make it explicit to silence the warning.
Signed-off-by Andrew Price <[email protected]>
--- gfs2/edit/savemeta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
gfs2/edit/savemeta.c +1 -1
@@ -712,7 +712,7 @@ static void get_journal_inode_blocks(void)static void save_allocated (struct rgrp_tree *rgd,struct metafd *mfd) {int blktype; -uint64_t blk; +uint64_t blk =0 ;unsigned i, j, m;uint64_t *ibuf =malloc (sbd.bsize *GFS2_NBBY *sizeof (uint64_t ));
Signature · 1 line
2.4.11