summaryrefslogtreecommitdiff
path: root/libexec/ld.so/library.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2014-07-10 09:03:03 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2014-07-10 09:03:03 +0000
commitd5c64fd23befba60623f0fa692b206274bcf5867 (patch)
treeb334e35329c1fc797fe8d85a04d820a11cc41bd3 /libexec/ld.so/library.c
parent8e422aee3fc1798232e2f85535bc4752836c2ecc (diff)
check all memory allocations; ok miod@ guenther@
Diffstat (limited to 'libexec/ld.so/library.c')
-rw-r--r--libexec/ld.so/library.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libexec/ld.so/library.c b/libexec/ld.so/library.c
index b5617157cf3..b8f0f6ea6ae 100644
--- a/libexec/ld.so/library.c
+++ b/libexec/ld.so/library.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: library.c,v 1.69 2014/07/09 12:54:03 guenther Exp $ */
+/* $OpenBSD: library.c,v 1.70 2014/07/10 09:03:01 otto Exp $ */
/*
* Copyright (c) 2002 Dale Rahn
@@ -196,6 +196,8 @@ _dl_tryload_shlib(const char *libname, int type, int flags)
} else
res = NULL; /* silence gcc */
next_load = _dl_calloc(1, sizeof(struct load_list));
+ if (next_load == NULL)
+ _dl_exit(7);
next_load->next = load_list;
load_list = next_load;
next_load->start = start;