#include <time.h>
#include <string.h>
#include "log.h"
+#include "memory.h"
#include "list.h"
#include "ban.h"
#include "conf.h"
ban_t *ban;
char hexhash[41];
- ban = calloc(1, sizeof(ban_t));
- if (ban == NULL)
- Log_fatal("Out of memory");
+ ban = Memory_safeCalloc(1, sizeof(ban_t));
memcpy(ban->hash, client->hash, 20);
for (i = 0; i < n_bans; i++) {
Msg_banList_getEntry(msg, i, &address, &mask, &name, &hexhash, &reason, &start, &duration);
- ban = malloc(sizeof(ban_t));
- if (ban == NULL)
- Log_fatal("Out of memory");
+ ban = Memory_safeMalloc(1, sizeof(ban_t));
SSLi_hex2hash(hexhash, ban->hash);
if(memcmp(address, mappedBytes, 12) == 0) {
if (p == NULL) break;
reason = p;
- ban = malloc(sizeof(ban_t));
- if (ban == NULL)
- Log_fatal("Out of memory");
+ ban = Memory_safeMalloc(1, sizeof(ban_t));
memset(ban, 0, sizeof(ban_t));
SSLi_hex2hash(hexhash, ban->hash);
if (inet_pton(AF_INET, address, &ban->address) == 0) {