diff --git a/lib/cluster/corosync.c b/lib/cluster/corosync.c index 86f7061e977..10ac46ddef0 100644 --- a/lib/cluster/corosync.c +++ b/lib/cluster/corosync.c @@ -328,7 +328,6 @@ init_cs_connection(crm_cluster_t * cluster) gboolean init_cs_connection_once(crm_cluster_t * cluster) { - const char *uuid = NULL; crm_node_t *peer = NULL; enum cluster_type_e stack = get_cluster_type(); @@ -359,11 +358,7 @@ init_cs_connection_once(crm_cluster_t * cluster) /* Ensure the local node always exists */ peer = crm_get_peer(cluster->nodeid, cluster->uname); - uuid = get_corosync_uuid(peer); - - if(uuid) { - cluster->uuid = strdup(uuid); - } + cluster->uuid = get_corosync_uuid(peer); return TRUE; } diff --git a/lib/cluster/cpg.c b/lib/cluster/cpg.c index 7862cab61ce..e3a6057a343 100644 --- a/lib/cluster/cpg.c +++ b/lib/cluster/cpg.c @@ -617,6 +617,7 @@ send_cluster_text(int class, const char *data, crm_trace("Queueing CPG message %u to %s (%d bytes, %d bytes payload): %.200s", msg->id, target, iov->iov_len, msg->size, data); } + free(target); #if SUPPORT_PLUGIN /* The plugin is the only time we dont use CPG messaging */ @@ -627,7 +628,6 @@ send_cluster_text(int class, const char *data, send_cpg_iov(iov); - free(target); return TRUE; } diff --git a/lib/cluster/legacy.c b/lib/cluster/legacy.c index f6af2464727..bad2193daaa 100644 --- a/lib/cluster/legacy.c +++ b/lib/cluster/legacy.c @@ -642,7 +642,6 @@ extern int set_cluster_type(enum cluster_type_e type); gboolean init_cs_connection_once(crm_cluster_t * cluster) { - const char *uuid = NULL; crm_node_t *peer = NULL; enum cluster_type_e stack = get_cluster_type(); @@ -687,11 +686,7 @@ init_cs_connection_once(crm_cluster_t * cluster) /* Ensure the local node always exists */ peer = crm_get_peer(cluster->nodeid, cluster->uname); - uuid = get_corosync_uuid(peer); - - if(uuid) { - cluster->uuid = strdup(uuid); - } + cluster->uuid = get_corosync_uuid(peer); return TRUE; }