if(msg_data == NULL || msg_data->data == NULL) {
struct crmd_ccm_data_s *ccm_data = fsa_typed_data(fsa_dt_ccm);  if(ccm_data == NULL) {
do_ccm_update_cache(long long action,		    enum crmd_fsa_cause cause,		    enum crmd_fsa_state cur_state,		    enum crmd_fsa_input current_input,		    fsa_data_t *msg_data){	enum crmd_fsa_input next_input = I_NULL;	int lpc, offset;	GHashTable *members = NULL;	oc_ed_t *event = NULL;	const oc_ev_membership_t *oc = NULL;	oc_node_list_t *tmp = NULL, *membership_copy = NULL;	if(msg_data == NULL || msg_data->data == NULL) {		crm_err("No data provided to FSA function");		return I_FAIL;	} else if(msg_data->fsa_cause != C_CCM_CALLBACK) {		crm_err("FSA function called in response to incorect input");		return I_NULL;	}	event = ((struct crmd_ccm_data_s *)msg_data->data)->event;	oc = ((struct crmd_ccm_data_s *)msg_data->data)->oc;	crm_info("Updating CCM cache after a \"%s\" event.", 	       *event==OC_EV_MS_NEW_MEMBERSHIP?"NEW MEMBERSHIP":	       *event==OC_EV_MS_NOT_PRIMARY?"NOT PRIMARY":	       *event==OC_EV_MS_PRIMARY_RESTORED?"PRIMARY RESTORED":	       *event==OC_EV_MS_EVICTED?"EVICTED":	       "NO QUORUM MEMBERSHIP");	crm_debug("instace=%d, nodes=%d, new=%d, lost=%d n_idx=%d, "		  "new_idx=%d, old_idx=%d",		  oc->m_instance,		  oc->m_n_member,		  oc->m_n_in,		  oc->m_n_out,		  oc->m_memb_idx,		  oc->m_in_idx,		  oc->m_out_idx);	crm_malloc(membership_copy, sizeof(oc_node_list_t));	if(membership_copy == NULL) {		crm_crit("Couldnt create membership copy - out of memory");		return I_ERROR;	}	crm_debug("Copying members");		/*--*-- All Member Nodes --*--*/	offset = oc->m_memb_idx;	membership_copy->members_size = oc->m_n_member;	if(membership_copy->members_size > 0) {		membership_copy->members =			g_hash_table_new(g_str_hash, g_str_equal);		members = membership_copy->members;				for(lpc=0; lpc < membership_copy->members_size; lpc++) {			oc_node_t *member = NULL;			crm_debug("Copying member %d", lpc);			crm_malloc(member, sizeof(oc_node_t));						if(member == NULL) {				continue;			}			member->node_id =				oc->m_array[offset+lpc].node_id;						member->node_born_on =				oc->m_array[offset+lpc].node_born_on;						member->node_uname = NULL;			if(oc->m_array[offset+lpc].node_uname != NULL) {				member->node_uname =					crm_strdup(oc->m_array[offset+lpc].node_uname);			} else {				crm_err("Node %d had a NULL uname",					member->node_id);			}			g_hash_table_insert(				members, member->node_uname, member);			}			} else {		membership_copy->members = NULL;	}		crm_debug("Copying new members");	/*--*-- New Member Nodes --*--*/	offset = oc->m_in_idx;	membership_copy->new_members_size = oc->m_n_in;	if(membership_copy->new_members_size > 0) {		membership_copy->new_members =			g_hash_table_new(g_str_hash, g_str_equal);		members = membership_copy->new_members;				for(lpc=0; lpc < membership_copy->new_members_size; lpc++) {			oc_node_t *member = NULL;			crm_malloc(member, sizeof(oc_node_t));			if(member == NULL) {				continue;			}						member->node_uname = NULL;			member->node_id = oc->m_array[offset+lpc].node_id;			member->node_born_on =				oc->m_array[offset+lpc].node_born_on;			if(oc->m_array[offset+lpc].node_uname != NULL) {				member->node_uname =					crm_strdup(oc->m_array[offset+lpc].node_uname);			} else {				crm_err("Node %d had a NULL uname",					member->node_id);			}			g_hash_table_insert(				members, member->node_uname, member);				g_hash_table_insert(members, member->node_uname, member);		}	} else {		membership_copy->new_members = NULL;	}		crm_debug("Copying dead members");	/*--*-- Recently Dead Member Nodes --*--*/	offset = oc->m_out_idx;	membership_copy->dead_members_size = oc->m_n_out;	if(membership_copy->dead_members_size > 0) {		membership_copy->dead_members =			g_hash_table_new(g_str_hash, g_str_equal);		members = membership_copy->dead_members;		for(lpc=0; lpc < membership_copy->dead_members_size; lpc++) {			oc_node_t *member = NULL;			crm_malloc(member, sizeof(oc_node_t));			if(member == NULL) {				continue;			}						member->node_id =				oc->m_array[offset+lpc].node_id;						member->node_born_on =				oc->m_array[offset+lpc].node_born_on;						member->node_uname = NULL;			if(oc->m_array[offset+lpc].node_uname != NULL) {				member->node_uname =					crm_strdup(oc->m_array[offset+lpc].node_uname);			} else {				crm_err("Node %d had a NULL uname",					member->node_id);			}			g_hash_table_insert(				members, member->node_uname, member);				g_hash_table_insert(members, member->node_uname, member);		}	} else {		membership_copy->dead_members = NULL;	}	crm_debug("Replacing old copies");	tmp = fsa_membership_copy;	fsa_membership_copy = membership_copy;	/* Free the old copy */	if(tmp != NULL) {		if(tmp->members != NULL)			g_hash_table_foreach_remove(				tmp->members, ghash_node_clfree, NULL);		if(tmp->new_members != NULL)			g_hash_table_foreach_remove(				tmp->new_members, ghash_node_clfree, NULL);		if(tmp->dead_members != NULL)			g_hash_table_foreach_remove(				tmp->dead_members, ghash_node_clfree, NULL);		crm_free(tmp);	}	crm_debug("Free'd old copies");	if(AM_I_DC) {		/* should be sufficient for only the DC to do this */		crm_debug("Updating the CIB");		free_xml(do_update_cib_nodes(NULL, FALSE));	}		set_bit_inplace(fsa_input_register, R_CCM_DATA);		return next_input;}