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

[Cluster-devel] [PATCH 10/41] 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\n");
+
 	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


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