CBNetworkAddress * CBNewNetworkAddress(uint64_t lastSeen, CBByteArray * ip, uint16_t port, CBVersionServices services, bool isPublic){ CBNetworkAddress * self = malloc(sizeof(*self)); if (NOT self) { CBLogError("Cannot allocate %i bytes of memory in CBNewNetworkAddress\n", sizeof(*self)); return NULL; } CBGetObject(self)->free = CBFreeNetworkAddress; if (CBInitNetworkAddress(self, lastSeen, ip, port, services, isPublic)) return self; free(self); return NULL; }
CBNetworkAddress * CBNewNetworkAddress(uint64_t lastSeen, CBByteArray * ip, uint16_t port, CBVersionServices services, bool isPublic){ CBNetworkAddress * self = malloc(sizeof(*self)); CBGetObject(self)->free = CBFreeNetworkAddress; CBInitNetworkAddress(self, lastSeen, ip, port, services, isPublic); return self; }