diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2011-08-24 20:05:13 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2011-08-24 20:05:13 +0000 |
| commit | 0e9a2605200b721fdfcf32d2c95f79a81fc84352 (patch) | |
| tree | cbf9abe0c68b62c518886f500059522babc1525d /libexec/rtld-elf/xmalloc.c | |
| parent | f3fb16875ce6de5f348adb955caac61755e49879 (diff) | |
Notes
Diffstat (limited to 'libexec/rtld-elf/xmalloc.c')
| -rw-r--r-- | libexec/rtld-elf/xmalloc.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libexec/rtld-elf/xmalloc.c b/libexec/rtld-elf/xmalloc.c index 7ee4c570c6b8..0d992257b986 100644 --- a/libexec/rtld-elf/xmalloc.c +++ b/libexec/rtld-elf/xmalloc.c @@ -25,10 +25,12 @@ * $FreeBSD$ */ -#include <err.h> #include <stddef.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> +#include "rtld.h" +#include "rtld_printf.h" void *xcalloc(size_t); void *xmalloc(size_t); @@ -44,8 +46,10 @@ void * xmalloc(size_t size) { void *p = malloc(size); - if (p == NULL) - err(1, "Out of memory"); + if (p == NULL) { + rtld_fdputstr(STDERR_FILENO, "Out of memory\n"); + _exit(1); + } return p; } @@ -53,7 +57,9 @@ char * xstrdup(const char *s) { char *p = strdup(s); - if (p == NULL) - err(1, "Out of memory"); + if (p == NULL) { + rtld_fdputstr(STDERR_FILENO, "Out of memory\n"); + _exit(1); + } return p; } |
