summaryrefslogtreecommitdiff
path: root/usr.sbin/sade/misc.c
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1995-05-01 21:56:32 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1995-05-01 21:56:32 +0000
commit411bac67a7d1706e23a81f47d72cda27e31cd303 (patch)
tree66e8a7a94085501f4c4c4f035003b8f42ba879d5 /usr.sbin/sade/misc.c
parentec27acc8cb283d8cf4482f2f3184a72d64230cd4 (diff)
Notes
Diffstat (limited to 'usr.sbin/sade/misc.c')
-rw-r--r--usr.sbin/sade/misc.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/sade/misc.c b/usr.sbin/sade/misc.c
index 4f789e2bea3a..794c49888fb6 100644
--- a/usr.sbin/sade/misc.c
+++ b/usr.sbin/sade/misc.c
@@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
- * $Id: misc.c,v 1.1.1.1 1995/04/27 12:50:35 jkh Exp $
+ * $Id: misc.c,v 1.2 1995/04/29 19:33:04 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -98,6 +98,18 @@ safe_free(void *ptr)
free(ptr);
}
+/* A malloc that checks errors */
+void *
+safe_malloc(size_t size)
+{
+ void *ptr;
+
+ ptr = malloc(size);
+ if (!ptr)
+ msgFatal("Out of memory!");
+ return ptr;
+}
+
/*
* These next routines are kind of specialized just for building string lists
* for dialog_menu().