summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-05-12 23:35:17 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-05-12 23:35:17 +0000
commit806e66133372cde767c08ba475f9a99947f2ca82 (patch)
treecf482dee0a6b83a8ede41c4d8e5b3a89de95f9f0
parent532d555e535db36981a31cd6235ae608adb7fd33 (diff)
do not call abort()
-rw-r--r--libexec/ld.so/ldconfig/etc.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/libexec/ld.so/ldconfig/etc.c b/libexec/ld.so/ldconfig/etc.c
index 80111fce6f7..b8f3eb07e33 100644
--- a/libexec/ld.so/ldconfig/etc.c
+++ b/libexec/ld.so/ldconfig/etc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: etc.c,v 1.6 2006/05/12 23:20:52 deraadt Exp $ */
+/* $OpenBSD: etc.c,v 1.7 2006/05/12 23:35:16 deraadt Exp $ */
/* Public Domain */
@@ -44,15 +44,12 @@ xrealloc(void *ptr, size_t size)
void *
xcalloc(size_t nmemb, size_t size)
{
- void *ret;
-
- ret = calloc(nmemb, size);
- if (ret == NULL) {
- printf("unable to allocate memory\n");
- abort();
- exit (20);
- }
- return ret;
+ void *ptr;
+
+ ptr = calloc(nmemb, size);
+ if (ptr == NULL)
+ err(1, OOM_MSG);
+ return ptr;
}
char *