Esempio n. 1
0
CBNetworkAddress * CBNewNetworkAddressFromData(CBByteArray * data, bool isPublic){
	CBNetworkAddress * self = malloc(sizeof(*self));
	if (NOT self) {
		CBLogError("Cannot allocate %i bytes of memory in CBNewNetworkAddressFromData\n", sizeof(*self));
		return NULL;
	}
	CBGetObject(self)->free = CBFreeNetworkAddress;
	if(CBInitNetworkAddressFromData(self, data, isPublic))
		return self;
	free(self);
	return NULL;
}
Esempio n. 2
0
CBNetworkAddress * CBNewNetworkAddressFromData(CBByteArray * data, bool isPublic){
	CBNetworkAddress * self = malloc(sizeof(*self));
	CBGetObject(self)->free = CBFreeNetworkAddress;
	CBInitNetworkAddressFromData(self, data, isPublic);
	return self;
}