summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf/rtld.h
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/rtld.h
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/rtld.h')
-rw-r--r--libexec/rtld-elf/rtld.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h
index 2aabffe..2bf9518 100644
--- a/libexec/rtld-elf/rtld.h
+++ b/libexec/rtld-elf/rtld.h
@@ -58,7 +58,7 @@
#endif
#define NEW(type) ((type *) xmalloc(sizeof(type)))
-#define CNEW(type) ((type *) xcalloc(sizeof(type)))
+#define CNEW(type) ((type *) xcalloc(1, sizeof(type)))
/* We might as well do booleans like C++. */
typedef unsigned char bool;
@@ -319,7 +319,7 @@ typedef struct Struct_SymLook {
extern void _rtld_error(const char *, ...) __printflike(1, 2);
extern const char *rtld_strerror(int);
extern Obj_Entry *map_object(int, const char *, const struct stat *);
-extern void *xcalloc(size_t);
+extern void *xcalloc(size_t, size_t);
extern void *xmalloc(size_t);
extern char *xstrdup(const char *);
extern Elf_Addr _GLOBAL_OFFSET_TABLE_[];
OpenPOWER on IntegriCloud