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: simplify code

Spotted by Coverity Scan

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
:100644 100644 7641294... 284b351... M cman/daemon/commands.c
cman/daemon/commands.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index 7641294..284b351 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -270,13 +270,12 @@ static struct cluster_node *add_new_node(char *name, int nodeid, int votes, int
newnode->incarnation = incarnation;
}
if (!newnode->name) {
- newnode->name = malloc(strlen(name)+1);
+ newnode->name = strdup(name);
if (!newnode->name) {
if (newalloc)
free(newnode);
return NULL;
}
- strcpy(newnode->name, name);
}

if (!newnode->node_id) /* Don't clobber existing nodeid */
--
1.7.4.4
 

Thread Tools




All times are GMT. The time now is 07:11 AM.

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