FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 01-06-2012, 02:19 PM
Andrew Price
 
Default gfs2_edit: Fix resource leaks in display_extended()

Spotted by coverity: Variable "tmp_inode" going out of scope leaks the
storage it points to.

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

diff --git a/gfs2/edit/extended.c b/gfs2/edit/extended.c
index 7fd770f..7c0ced5 100644
--- a/gfs2/edit/extended.c
+++ b/gfs2/edit/extended.c
@@ -669,30 +669,35 @@ int display_extended(void)
tmp_bh = bread(&sbd, masterblock("rindex"));
tmp_inode = inode_get(&sbd, tmp_bh);
parse_rindex(tmp_inode, FALSE);
+ inode_put(&tmp_inode);
brelse(tmp_bh);
}
else if (block_is_jindex()) {
tmp_bh = bread(&sbd, block);
tmp_inode = inode_get(&sbd, tmp_bh);
print_jindex(tmp_inode);
+ inode_put(&tmp_inode);
brelse(tmp_bh);
}
else if (block_is_inum_file()) {
tmp_bh = bread(&sbd, block);
tmp_inode = inode_get(&sbd, tmp_bh);
print_inum(tmp_inode);
+ inode_put(&tmp_inode);
brelse(tmp_bh);
}
else if (block_is_statfs_file()) {
tmp_bh = bread(&sbd, block);
tmp_inode = inode_get(&sbd, tmp_bh);
print_statfs(tmp_inode);
+ inode_put(&tmp_inode);
brelse(tmp_bh);
}
else if (block_is_quota_file()) {
tmp_bh = bread(&sbd, block);
tmp_inode = inode_get(&sbd, tmp_bh);
print_quota(tmp_inode);
+ inode_put(&tmp_inode);
brelse(tmp_bh);
}
return 0;
--
1.7.6.4
 

Thread Tools




All times are GMT. The time now is 10:47 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org