chlink.destination);
else
ch_dst = ch_itr;
-
+
chl = malloc(sizeof(channellist_t));
+ if(!chl)
+ Log_fatal("Out of memory");
chl->chan = ch_dst;
init_list_entry(&chl->node);
list_add_tail(&chl->node, &ch_src->channel_links);
channel_t *sub;
chl = malloc(sizeof(channellist_t));
+ if(!chl)
+ Log_fatal("Out of memory");
chl->chan = ch;
init_list_entry(&chl->node);
list_add_tail(&chl->node, head);
sendmsg->payload.channelState->n_links = ch_itr->linkcount;
links = (uint32_t *)malloc(ch_itr->linkcount * sizeof(uint32_t));
+ if(!links)
+ Log_fatal("Out of memory");
+
list_iterate(itr, &ch_itr->channel_links) { /* Iterate links */
channellist_t *chl;
channel_t *ch;
testsocket = socket(PF_INET6, SOCK_STREAM, 0);
hasv6 = (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT) ? false : true;
if (!(testsocket < 0)) close(testsocket);
-
+
if(!hasv4)
{
Log_info("IPv4 is not supported by this system");
struct sockaddr_storage** Server_setupAddressesAndPorts()
{
struct sockaddr_storage** addresses = calloc(2, sizeof(void*));
+ if(!addresses)
+ Log_fatal("Not enough memory to allocate addresses");
struct sockaddr_storage* v4address = calloc(1, sizeof(struct sockaddr_storage));
v4address->ss_family = AF_INET;
+ if(!v4address)
+ Log_fatal("Not enough memory to allocate IPv4 address");
+
struct sockaddr_storage* v6address = calloc(1, sizeof(struct sockaddr_storage));
v6address->ss_family = AF_INET6;
+ if(!v4address)
+ Log_fatal("Not enough memory to allocate IPv6 address");
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
v4address->ss_len = sizeof(struct sockaddr_storage);