* [Cluster-devel] [PATCH 1/2] fsck.gfs2: Fix a potential memory leak in pass3
@ 2016-05-10 14:43 Andrew Price
2016-05-10 14:43 ` [Cluster-devel] [PATCH 2/2] gfs2_edit savemeta: Fix use of uninitialized 'blk' Andrew Price
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Price @ 2016-05-10 14:43 UTC (permalink / raw)
To: cluster-devel.redhat.com
Coverity spotted an instance where pass3() breaks out of the loop
without first freeing the inode.
Signed-off-by: Andrew Price <anprice@redhat.com>
---
gfs2/fsck/pass3.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gfs2/fsck/pass3.c b/gfs2/fsck/pass3.c
index fbf8318..85d7e36 100644
--- a/gfs2/fsck/pass3.c
+++ b/gfs2/fsck/pass3.c
@@ -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 "
--
2.4.11
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [PATCH 2/2] gfs2_edit savemeta: Fix use of uninitialized 'blk'
2016-05-10 14:43 [Cluster-devel] [PATCH 1/2] fsck.gfs2: Fix a potential memory leak in pass3 Andrew Price
@ 2016-05-10 14:43 ` Andrew Price
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Price @ 2016-05-10 14:43 UTC (permalink / raw)
To: cluster-devel.redhat.com
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 <anprice@redhat.com>
---
gfs2/edit/savemeta.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 8510d77..db9a947 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -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));
--
2.4.11
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-10 14:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-10 14:43 [Cluster-devel] [PATCH 1/2] fsck.gfs2: Fix a potential memory leak in pass3 Andrew Price
2016-05-10 14:43 ` [Cluster-devel] [PATCH 2/2] gfs2_edit savemeta: Fix use of uninitialized 'blk' Andrew Price
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).