summaryrefslogtreecommitdiff
path: root/source4/lib/talloc/talloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/talloc/talloc.c')
-rw-r--r--source4/lib/talloc/talloc.c89
1 files changed, 0 insertions, 89 deletions
diff --git a/source4/lib/talloc/talloc.c b/source4/lib/talloc/talloc.c
index 8f7906d0d8..b2b00d8c65 100644
--- a/source4/lib/talloc/talloc.c
+++ b/source4/lib/talloc/talloc.c
@@ -1086,29 +1086,6 @@ void *_talloc_zero(const void *ctx, size_t size, const char *name)
return p;
}
-
-/*
- talloc and zero memory.
- Strict version - returns NULL if size is zero.
-*/
-void *_talloc_zero_strict(const void *ctx, size_t size, const char *name)
-{
- void *p;
-
- if (unlikely(size == 0)) {
- return NULL;
- }
-
- p = _talloc_named_const(ctx, size, name);
-
- if (p) {
- memset(p, '\0', size);
- }
-
- return p;
-}
-
-
/*
memdup with a talloc.
*/
@@ -1124,26 +1101,6 @@ void *_talloc_memdup(const void *t, const void *p, size_t size, const char *name
}
/*
- memdup with a talloc.
- Strict version - returns NULL if size is zero.
-*/
-void *_talloc_memdup_strict(const void *t, const void *p, size_t size, const char *name)
-{
- void *newp;
-
- if (unlikely(size == 0)) {
- return NULL;
- }
-
- newp = _talloc_named_const(t, size, name);
- if (likely(newp)) {
- memcpy(newp, p, size);
- }
-
- return newp;
-}
-
-/*
strdup with a talloc
*/
char *talloc_strdup(const void *t, const char *p)
@@ -1324,23 +1281,6 @@ void *_talloc_array(const void *ctx, size_t el_size, unsigned count, const char
}
/*
- alloc an array, checking for integer overflow in the array size.
- Strict version - returns NULL if count or el_size are zero.
-*/
-void *_talloc_array_strict(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
*/
void *_talloc_zero_array(const void *ctx, size_t el_size, unsigned count, const char *name)
@@ -1352,24 +1292,6 @@ void *_talloc_zero_array(const void *ctx, size_t el_size, unsigned count, const
}
/*
- alloc an zero array, checking for integer overflow in the array size
- Strict version - returns NULL if count or el_size are zero.
-*/
-void *_talloc_zero_array_strict(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);
-}
-
-
-/*
realloc an array, checking for integer overflow in the array size
*/
void *_talloc_realloc_array(const void *ctx, void *ptr, size_t el_size, unsigned count, const char *name)
@@ -1497,14 +1419,3 @@ int talloc_is_parent(const void *context, const void *ptr)
}
return 0;
}
-
-/*
- Talloc wrapper that returns NULL if size == 0.
-*/
-void *talloc_strict(const void *context, size_t size, const char *name)
-{
- if (unlikely(size == 0)) {
- return NULL;
- }
- return _talloc_named_const(context, size, name);
-}