repo.or.cz
/
tftp-hpa.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Make sure we include <sys/socket.h> when checking for socklen_t
[tftp-hpa.git]
/
lib
/
xmalloc.c
blob
6e8ae24ed70dac0dab5d39e026c9563bf6c9903f
1
/*
2
* xmalloc.c
3
*
4
* Simple error-checking version of malloc()
5
*
6
*/
7
8
#include <stdlib.h>
9
#include <stdio.h>
10
11
void
*
xmalloc
(
size_t
size
)
12
{
13
void
*
p
=
malloc
(
size
);
14
15
if
( !
p
) {
16
fprintf
(
stderr
,
"Out of memory!
\n
"
);
17
exit
(
128
);
18
}
19
20
return
p
;
21
}