git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
621cf3c
)
Provide malloc_array() in Samba 4.
author
Jelmer Vernooij
<jelmer@samba.org>
Sat, 11 Oct 2008 17:44:10 +0000
(19:44 +0200)
committer
Jelmer Vernooij
<jelmer@samba.org>
Sat, 11 Oct 2008 19:03:12 +0000
(21:03 +0200)
source4/lib/util/util.c
patch
|
blob
|
history
diff --git
a/source4/lib/util/util.c
b/source4/lib/util/util.c
index b5bb75358e107e18e22383eddcaff0217c86a16f..5fc785d642db96da2c8b357c853266efe083c04e 100644
(file)
--- 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;