Index: /trunk/Nebulous/nebclient/xmalloc.c
===================================================================
--- /trunk/Nebulous/nebclient/xmalloc.c	(revision 2927)
+++ /trunk/Nebulous/nebclient/xmalloc.c	(revision 2927)
@@ -0,0 +1,34 @@
+/*
+ * xmalloc.c - malloc that can't fail
+ *
+ * Copyright (C) 2003  Robert Lupton
+ *
+ * $Id: xmalloc.c,v 1.1 2005-01-06 22:10:48 jhoblitt Exp $
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "xmalloc.h"
+
+/*****************************************************************************/
+/*
+ * Wrappers for malloc/free.  xmalloc cannot fail.
+ */
+void *
+xmalloc(size_t n)
+{
+   void *ptr = malloc(n);
+    
+   if (ptr == NULL) {
+      perror("malloc");
+      exit(EXIT_FAILURE);
+   }
+ 
+   return(ptr);
+}
+ 
+void
+xfree(void *ptr)
+{
+   free(ptr);
+}
Index: /trunk/Nebulous/nebclient/xmalloc.h
===================================================================
--- /trunk/Nebulous/nebclient/xmalloc.h	(revision 2927)
+++ /trunk/Nebulous/nebclient/xmalloc.h	(revision 2927)
@@ -0,0 +1,13 @@
+/*
+ * xmalloc.h - malloc that can't fail
+ *
+ * Copyright (C) 2003  Robert Lupton
+ *
+ * $Id: xmalloc.h,v 1.1 2005-01-06 22:10:49 jhoblitt Exp $
+ */
+
+void *
+xmalloc(size_t n);
+ 
+void
+xfree(void *ptr);
