From 4604ca430294d8d9a522dd29705e7a7a1c969304 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 11 Oct 2008 19:44:10 +0200 Subject: Provide malloc_array() in Samba 4. --- source4/lib/util/util.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source4/lib') diff --git a/source4/lib/util/util.c b/source4/lib/util/util.c index b5bb75358e..5fc785d642 100644 --- a/source4/lib/util/util.c +++ b/source4/lib/util/util.c @@ -582,6 +582,15 @@ _PUBLIC_ void *realloc_array(void *ptr, size_t el_size, unsigned count) return realloc(ptr, el_size * count); } +/**************************************************************************** + Type-safe malloc. +****************************************************************************/ + +void *malloc_array(size_t el_size, unsigned int count) +{ + return realloc_array(NULL, el_size, count); +} + _PUBLIC_ void *talloc_check_name_abort(const void *ptr, const char *name) { void *result; -- cgit