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 11-23-2011, 09:15 AM
"Fabio M. Di Nitto"
 
Default cman_tool: check that memory is allocated

Spotted by Coverity Scan

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
:100644 100644 5a5aa7b... 46c315d... M cman/cman_tool/main.c
cman/cman_tool/main.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/cman/cman_tool/main.c b/cman/cman_tool/main.c
index 5a5aa7b..46c315d 100644
--- a/cman/cman_tool/main.c
+++ b/cman/cman_tool/main.c
@@ -539,6 +539,9 @@ static void show_nodes(commandline_t *comline)
/* Get Disallowed nodes, so we can show them as such */
dis_nodes = malloc(sizeof(cman_node_t) * count);

+ if (!dis_nodes)
+ die("cannot allocate memory for disallowed node
");
+
if (cman_get_disallowed_nodes(h, count, &dis_count, dis_nodes) == 0) {
for (i = 0; i < numnodes; i++) {
for (j = 0; j < dis_count; j++) {
--
1.7.4.4
 

Thread Tools




All times are GMT. The time now is 01:07 PM.

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