aboutsummaryrefslogtreecommitdiff
path: root/contrib/xntpd/lib/emalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/xntpd/lib/emalloc.c')
-rw-r--r--contrib/xntpd/lib/emalloc.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/xntpd/lib/emalloc.c b/contrib/xntpd/lib/emalloc.c
new file mode 100644
index 000000000000..d2a8e789f012
--- /dev/null
+++ b/contrib/xntpd/lib/emalloc.c
@@ -0,0 +1,20 @@
+/* emalloc.c,v 3.1 1993/07/06 01:08:15 jbj Exp
+ * 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)
+ unsigned int size;
+{
+ char *mem;
+
+ if ((mem = (char *)malloc(size)) == 0) {
+ syslog(LOG_ERR, "No more memory!");
+ exit(1);
+ }
+ return mem;
+}