diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-02 01:42:06 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:31 -0500 |
commit | 3c7251ee7889a9eb7d71d4fcb48dc5474a19fc05 (patch) | |
tree | f3028d5c37f9f081e14229e6d54580d5773ecf94 /source4/lib | |
parent | cc2da2ad678e939de63e96134c2102d3732bfc30 (diff) | |
download | samba-3c7251ee7889a9eb7d71d4fcb48dc5474a19fc05.tar.gz samba-3c7251ee7889a9eb7d71d4fcb48dc5474a19fc05.tar.bz2 samba-3c7251ee7889a9eb7d71d4fcb48dc5474a19fc05.zip |
r2773: allow zero sized array talloc
(This used to be commit 06c58ad221ec40e46310e847ebf640bd53e8e468)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/talloc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source4/lib/talloc.c b/source4/lib/talloc.c index 9d8caeb0e7..4032039142 100644 --- a/source4/lib/talloc.c +++ b/source4/lib/talloc.c @@ -880,8 +880,7 @@ char *talloc_asprintf_append(char *s, const char *fmt, ...) */ void *talloc_array(const void *ctx, size_t el_size, unsigned count, const char *name) { - if (count == 0 || - count >= MAX_TALLOC_SIZE/el_size) { + if (count >= MAX_TALLOC_SIZE/el_size) { return NULL; } return talloc_named_const(ctx, el_size * count, name); @@ -893,8 +892,7 @@ void *talloc_array(const void *ctx, size_t el_size, unsigned count, const char * */ void *talloc_realloc_array(const void *ctx, void *ptr, size_t el_size, unsigned count, const char *name) { - if (count == 0 || - count >= MAX_TALLOC_SIZE/el_size) { + if (count >= MAX_TALLOC_SIZE/el_size) { return NULL; } ptr = talloc_realloc(ctx, ptr, el_size * count); |