fix memory leak
[trinity.git] / utils.c
blobb8ee324c27cb2f578cfc9075667711951d6d595b
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <string.h>
4 #include "utils.h"
6 void * zmalloc(size_t size)
8 void *p;
10 p = malloc(size);
11 if (p == NULL) {
12 printf("malloc(%zu) failure.\n", size);
13 exit(EXIT_FAILURE);
16 memset(p, 0, size);
17 return p;