summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf/ia64/reloc.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-03-22 14:20:51 +0000
committerkib <kib@FreeBSD.org>2012-03-22 14:20:51 +0000
commit625402758bbbfc93f3af7661c735780ad2f94cd5 (patch)
tree575831251bf75cadb2609a8e274cbb1bac859020 /libexec/rtld-elf/ia64/reloc.c
parent348388ff1ced917315af86330df398adb549d318 (diff)
downloadFreeBSD-src-625402758bbbfc93f3af7661c735780ad2f94cd5.zip
FreeBSD-src-625402758bbbfc93f3af7661c735780ad2f94cd5.tar.gz
Use xmalloc() instead of malloc() in the places where malloc() calls
are assumed to not fail. Make the xcalloc() calling conventions follow the calloc(3) calling conventions and replace unchecked calls to calloc() with calls to xcalloc(). Remove redundand declarations from xmalloc.c, which are already present in rtld.h. Reviewed by: kan Discussed with: bde MFC after: 2 weeks
Diffstat (limited to 'libexec/rtld-elf/ia64/reloc.c')
-rw-r--r--libexec/rtld-elf/ia64/reloc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libexec/rtld-elf/ia64/reloc.c b/libexec/rtld-elf/ia64/reloc.c
index 1afcecf..01e20b8 100644
--- a/libexec/rtld-elf/ia64/reloc.c
+++ b/libexec/rtld-elf/ia64/reloc.c
@@ -87,7 +87,7 @@ alloc_fptr(Elf_Addr target, Elf_Addr gp)
struct fptr* fptr;
if (next_fptr == last_fptr) {
- current_chunk = malloc(sizeof(struct fptr_chunk));
+ current_chunk = xmalloc(sizeof(struct fptr_chunk));
next_fptr = &current_chunk->fptrs[0];
last_fptr = &current_chunk->fptrs[FPTR_CHUNK_SIZE];
}
@@ -116,9 +116,7 @@ alloc_fptrs(Obj_Entry *obj, bool mapped)
if (fptrs == MAP_FAILED)
fptrs = NULL;
} else {
- fptrs = malloc(fbytes);
- if (fptrs != NULL)
- memset(fptrs, 0, fbytes);
+ fptrs = xcalloc(1, fbytes);
}
/*
OpenPOWER on IntegriCloud