diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-07 11:03:16 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-09 12:40:08 +0200 |
commit | 8459391e31079066745a65c5f3c07f3899afdc0c (patch) | |
tree | 2a77cdcfd6ff27be80d34b88cfaef7b1c962004e /source3/lib/util.c | |
parent | 9f02fb51d41c2c2bf285ab6d25138f0b7b0cba81 (diff) | |
download | samba-8459391e31079066745a65c5f3c07f3899afdc0c.tar.gz samba-8459391e31079066745a65c5f3c07f3899afdc0c.tar.xz samba-8459391e31079066745a65c5f3c07f3899afdc0c.zip |
s3-talloc Remove unused TALLOC zeronull functions and macro definitions
These have been under #if 0 for a long time now.
Andrew Bartlett
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r-- | source3/lib/util.c | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index a596385bfb..5aad243593 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2140,111 +2140,6 @@ void split_domain_user(TALLOC_CTX *mem_ctx, } } -#if 0 - -Disable these now we have checked all code paths and ensured -NULL returns on zero request. JRA. - -/**************************************************************** - talloc wrapper functions that guarentee a null pointer return - if size == 0. -****************************************************************/ - -#ifndef MAX_TALLOC_SIZE -#define MAX_TALLOC_SIZE 0x10000000 -#endif - -/* - * talloc and zero memory. - * - returns NULL if size is zero. - */ - -void *_talloc_zero_zeronull(const void *ctx, size_t size, const char *name) -{ - void *p; - - if (size == 0) { - return NULL; - } - - p = talloc_named_const(ctx, size, name); - - if (p) { - memset(p, '\0', size); - } - - return p; -} - -/* - * memdup with a talloc. - * - returns NULL if size is zero. - */ - -void *_talloc_memdup_zeronull(const void *t, const void *p, size_t size, const char *name) -{ - void *newp; - - if (size == 0) { - return NULL; - } - - newp = talloc_named_const(t, size, name); - if (newp) { - memcpy(newp, p, size); - } - - return newp; -} - -/* - * alloc an array, checking for integer overflow in the array size. - * - returns NULL if count or el_size are zero. - */ - -void *_talloc_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name) -{ - if (count >= MAX_TALLOC_SIZE/el_size) { - return NULL; - } - - if (el_size == 0 || count == 0) { - return NULL; - } - - return talloc_named_const(ctx, el_size * count, name); -} - -/* - * alloc an zero array, checking for integer overflow in the array size - * - returns NULL if count or el_size are zero. - */ - -void *_talloc_zero_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name) -{ - if (count >= MAX_TALLOC_SIZE/el_size) { - return NULL; - } - - if (el_size == 0 || count == 0) { - return NULL; - } - - return _talloc_zero(ctx, el_size * count, name); -} - -/* - * Talloc wrapper that returns NULL if size == 0. - */ -void *talloc_zeronull(const void *context, size_t size, const char *name) -{ - if (size == 0) { - return NULL; - } - return talloc_named_const(context, size, name); -} -#endif - /**************************************************************** strip off leading '\\' from a hostname ****************************************************************/ |