#include <stdlib.h>
#include <string.h>
#include "log.h"
+#include "memory.h"
#include "list.h"
#include "client.h"
#include "channel.h"
{
channel_t *ch;
- ch = malloc(sizeof(channel_t));
- if (ch == NULL)
- Log_fatal("out of memory");
+ ch = Memory_safeMalloc(1, sizeof(channel_t));
memset(ch, 0, sizeof(channel_t));
ch->id = id;
ch->name = strdup(name);
chlink.destination);
else
ch_dst = ch_itr;
-
- chl = malloc(sizeof(channellist_t));
+
+ chl = Memory_safeMalloc(1, sizeof(channellist_t));
chl->chan = ch_dst;
init_list_entry(&chl->node);
list_add_tail(&chl->node, &ch_src->channel_links);
struct dlist *itr;
channel_t *sub;
- chl = malloc(sizeof(channellist_t));
+ chl = Memory_safeMalloc(1, sizeof(channellist_t));
chl->chan = ch;
init_list_entry(&chl->node);
list_add_tail(&chl->node, head);