color_copy = (color_t *)crm_malloc(sizeof(color_t)); color_copy->id      = a_color->id; color_copy->details = a_color->details; color_copy->local_weight = 1.0;
crm_malloc(color_copy, sizeof(color_t)); if(color_copy != NULL) { color_copy->id      = a_color->id; color_copy->details = a_color->details; color_copy->local_weight = 1.0; }
copy_color(color_t *a_color) {	color_t *color_copy = NULL;	if(a_color == NULL) {		crm_err("Cannot copy NULL");		return NULL;	}		color_copy = (color_t *)crm_malloc(sizeof(color_t));	color_copy->id      = a_color->id;	color_copy->details = a_color->details;	color_copy->local_weight = 1.0;		return color_copy;}