action = crm_malloc(sizeof(action_t));
crm_malloc(action, sizeof(action_t)); if(action == NULL) { return NULL; }
unpack_action(xmlNodePtr xml_action) {	const char *tmp        = xmlGetProp(xml_action, "id");	action_t   *action     = NULL;	xmlNodePtr action_copy = NULL;	if(tmp == NULL) {		crm_err("Actions must have an id!");		crm_xml_devel(xml_action, "Action with missing id");		return NULL;	}		action_copy = copy_xml_node_recursive(xml_action);	action = crm_malloc(sizeof(action_t));	action->id       = atoi(tmp);	action->timeout  = 0;	action->timer_id = -1;	action->invoked  = FALSE;	action->complete = FALSE;	action->can_fail = FALSE;	action->type     = action_type_rsc; 	action->xml      = action_copy;		if(safe_str_eq(action_copy->name, "rsc_op")) {		action->type = action_type_rsc;	} else if(safe_str_eq(action_copy->name, "pseudo_event")) {		action->type = action_type_pseudo;	} else if(safe_str_eq(action_copy->name, "crm_event")) {		action->type = action_type_crm;	}	tmp = xmlGetProp(action_copy, "timeout");	if(tmp != NULL) {		action->timeout = atoi(tmp);	}	tmp = xmlGetProp(action_copy, "can_fail");	if(safe_str_eq(tmp, "true")) {		action->can_fail = TRUE;	}	return action;}