summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c105
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
****************************************************************/