mirror of
https://kernel.googlesource.com/pub/scm/network/tftp/tftp-hpa
synced 2025-04-30 11:59:54 +03:00
20 lines
238 B
C
20 lines
238 B
C
/*
|
|
* xmalloc.c
|
|
*
|
|
* Simple error-checking version of malloc()
|
|
*
|
|
*/
|
|
|
|
#include "config.h"
|
|
|
|
void *xmalloc(size_t size)
|
|
{
|
|
void *p = malloc(size);
|
|
|
|
if ( !p ) {
|
|
fprintf(stderr, "Out of memory!\n");
|
|
exit(128);
|
|
}
|
|
|
|
return p;
|
|
}
|