summaryrefslogtreecommitdiff
path: root/source3/lib/talloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/talloc.c')
-rw-r--r--source3/lib/talloc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source3/lib/talloc.c b/source3/lib/talloc.c
index cfd130e888..97ba196e2a 100644
--- a/source3/lib/talloc.c
+++ b/source3/lib/talloc.c
@@ -62,7 +62,7 @@ void *talloc(TALLOC_CTX *t, size_t size)
tc = malloc(sizeof(*tc));
if (!tc) {
- free(p);
+ SAFE_FREE(p);
return NULL;
}
@@ -112,12 +112,11 @@ void talloc_destroy_pool(TALLOC_CTX *t)
while (t->list) {
c = t->list->next;
- if (t->list->ptr) free(t->list->ptr);
- free(t->list);
+ SAFE_FREE(t->list->ptr);
+ SAFE_FREE(t->list);
t->list = c;
}
- t->list = NULL;
t->total_alloc_size = 0;
}
@@ -128,7 +127,7 @@ void talloc_destroy(TALLOC_CTX *t)
return;
talloc_destroy_pool(t);
memset(t, 0, sizeof(*t));
- free(t);
+ SAFE_FREE(t);
}
/* return the current total size of the pool. */