summaryrefslogtreecommitdiffstats
path: root/lib/xmalloc.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1998-05-03 18:43:39 +0200
committerMartin Mares <mj@ucw.cz>1998-05-03 18:43:39 +0200
commit18c8241a91bd9208879666f1a1a13f454e66d75b (patch)
tree8bdc5f3e384b6b9198d5ab834d869c8d1fb261a7 /lib/xmalloc.c
parenta8b6038225d18155883e330c96b2bc2e44153e1e (diff)
downloadbird-18c8241a91bd9208879666f1a1a13f454e66d75b.tar
bird-18c8241a91bd9208879666f1a1a13f454e66d75b.zip
BIRD library: The story continues.
Complete resource manages and IP address handling.
Diffstat (limited to 'lib/xmalloc.c')
-rw-r--r--lib/xmalloc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/xmalloc.c b/lib/xmalloc.c
new file mode 100644
index 0000000..c1ce7ea
--- /dev/null
+++ b/lib/xmalloc.c
@@ -0,0 +1,21 @@
+/*
+ * BIRD Library -- malloc() With Checking
+ *
+ * (c) 1998 Martin Mares <mj@ucw.cz>
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+#include <stdlib.h>
+
+#include "nest/bird.h"
+#include "lib/resource.h"
+
+void *
+xmalloc(unsigned size)
+{
+ void *p = malloc(size);
+ if (p)
+ return p;
+ die("Unable to allocate %d bytes of memory", size);
+}