diff options
| author | christos <christos@NetBSD.org> | 2013-09-03 08:44:45 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2013-09-03 08:44:45 +0000 |
| commit | bafe33375677b2a85d06b22fa854ffa0d91d1dc3 (patch) | |
| tree | 1dbaa9c1bed8e2ab2130147777330ae6558c54b2 /lib/libexecinfo | |
| parent | eb85ae4fd72b6b92dcdcd44f3fcf60d35228f8cf (diff) | |
print an error if we failed to allocate.
Diffstat (limited to 'lib/libexecinfo')
| -rw-r--r-- | lib/libexecinfo/symtab.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libexecinfo/symtab.c b/lib/libexecinfo/symtab.c index 92d92dc20bc..19f9839de05 100644 --- a/lib/libexecinfo/symtab.c +++ b/lib/libexecinfo/symtab.c @@ -1,4 +1,4 @@ -/* $NetBSD: symtab.c,v 1.2 2013/08/29 15:01:57 christos Exp $ */ +/* $NetBSD: symtab.c,v 1.3 2013/09/03 08:44:45 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__RCSID("$NetBSD: symtab.c,v 1.2 2013/08/29 15:01:57 christos Exp $"); +__RCSID("$NetBSD: symtab.c,v 1.3 2013/09/03 08:44:45 christos Exp $"); #include <stdlib.h> #include <stdio.h> @@ -139,8 +139,10 @@ symtab_create(int fd, int bind, int type) s->st_info = sym.st_info; s->st_name = strdup( elf_strptr(elf, shdr.sh_link, sym.st_name)); - if (s->st_name == NULL) + if (s->st_name == NULL) { + warn("Cannot allocate symbol"); goto out; + } s++; } st->nsymbols = s - st->symbols; |
