repo.or.cz
/
trinity.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
fix memory leak
[trinity.git]
/
utils.c
blob
b8ee324c27cb2f578cfc9075667711951d6d595b
1
#include <stdlib.h>
2
#include <stdio.h>
3
#include <string.h>
4
#include
"utils.h"
5
6
void
*
zmalloc
(
size_t
size
)
7
{
8
void
*
p
;
9
10
p
=
malloc
(
size
);
11
if
(
p
==
NULL
) {
12
printf
(
"malloc(%zu) failure.
\n
"
,
size
);
13
exit
(
EXIT_FAILURE
);
14
}
15
16
memset
(
p
,
0
,
size
);
17
return
p
;
18
}