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; }
CBNetworkAddress * CBNewNetworkAddressFromData(CBByteArray * data, bool isPublic){ CBNetworkAddress * self = malloc(sizeof(*self)); CBGetObject(self)->free = CBFreeNetworkAddress; CBInitNetworkAddressFromData(self, data, isPublic); return self; }