if(msg_reference != NULL) {  char *filename; int filename_len = 31 + strlen(msg_reference); filename = ha_malloc(sizeof(char)*filename_len); sprintf(filename, "test-%s_%d.xml", msg_reference, recieved_responses); filename[filename_len-1] = '\0'; if(xmlSaveFormatFile(filename, root->doc, 1) < 0) { cl_log(LOG_CRIT, "Couuld not save response to file test-%s_%d.xml", msg_reference, recieved_responses); }  }  
admin_msg_callback(const struct ha_msg* msg, void* private_data){    static int recieved_responses = 0;    cl_log(LOG_DEBUG, "admin_msg_callback: processing HA message");    xmlNodePtr root = validate_and_decode_hamessage(msg);    if(root == NULL)    {	cl_log(LOG_INFO, "Message (%s from %s) was not valid... discarding message.", ha_msg_value(msg, F_SEQ), ha_msg_value(msg, F_ORIG));	return;    }    if(validate_crm_message(root, "admin", "response") == FALSE)    {	cl_log(LOG_INFO, "Message (%s from %s) was not valid... discarding message.", ha_msg_value(msg, F_SEQ), ha_msg_value(msg, F_ORIG));	return;    }    if(strcmp("response", xmlGetProp(root, XML_MSG_ATTR_MSGTYPE)) != 0)    {	cl_log(LOG_ERR, "The admin client does not accept requests");	return;    }    recieved_responses++;    // do stuff    if(recieved_responses >= expected_responses)    {	cl_log(LOG_INFO, "Recieved expected number (%d) of messages from Heartbeat.  Exiting normally.", expected_responses);	g_main_quit(mainloop);    }    }
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/ea49e927cf7a87359e44d087341624427b4dacc8/adminmain.c/buggy/crm/admin/adminmain.c