summaryrefslogtreecommitdiffstats
path: root/usr.sbin/xntpd/lib/emalloc.c
blob: 61d4cb6a97863071e7645227a907528bab26fa12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * emalloc - return new memory obtained from the system.  Belch if none.
 */
#include "ntp_types.h"
#include "ntp_malloc.h"
#include "ntp_stdlib.h"
#include "ntp_syslog.h"

char *
emalloc(size)
	u_int size;
{
	char *mem;

	if ((mem = (char *)malloc(size)) == 0) {
		syslog(LOG_ERR, "No more memory!");
		exit(1);
	}
	return mem;
}
OpenPOWER on IntegriCloud