}
out3: close(ipfixReceiver->socket); out2: destroyTemplateBuffer(ipfixReceiver->templateBuffer); out1: free(ipfixReceiver); out: return NULL;  }
IpfixReceiver* rcvIpfixUdpIpv4(uint16_t port) {	IpfixReceiver* ipfixReceiver = (IpfixReceiver*)malloc(sizeof(IpfixReceiver));	ipfixReceiver->templateCallbackFunction = 0;	ipfixReceiver->dataTemplateCallbackFunction = 0;	ipfixReceiver->optionsTemplateCallbackFunction = 0;	ipfixReceiver->templateDestructionCallbackFunction = 0;	ipfixReceiver->dataTemplateDestructionCallbackFunction = 0;	ipfixReceiver->optionsTemplateDestructionCallbackFunction = 0;	ipfixReceiver->dataRecordCallbackFunction = 0;	ipfixReceiver->optionsRecordCallbackFunction = 0;	ipfixReceiver->dataDataRecordCallbackFunction = 0;		ipfixReceiver->templateBuffer = createTemplateBuffer();		pthread_mutex_lock(&ipfixReceiver->mutex);	ipfixReceiver->socket = socket(AF_INET, SOCK_DGRAM, 0);	if(ipfixReceiver->socket < 0) {		perror("socket");		return NULL;		}	struct sockaddr_in serverAddress;	serverAddress.sin_family = AF_INET;	serverAddress.sin_addr.s_addr = htonl(INADDR_ANY);	serverAddress.sin_port = htons(port);	int i = bind(ipfixReceiver->socket, (struct sockaddr*)&serverAddress, sizeof(struct sockaddr_in));	if(i < 0) {		perror("bind");		return NULL;		}	pthread_t thread; 	pthread_create(&thread, 0, listenerUdpIpv4, ipfixReceiver);	//listenerUdpIpv4(ipfixReceiver); //debug - single-threaded		return ipfixReceiver;	}