summaryrefslogtreecommitdiff
path: root/source3/lib/talloc.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2001-09-17 02:19:44 +0000
committerSimo Sorce <idra@samba.org>2001-09-17 02:19:44 +0000
commit484a7c0341fe033fe26fe1e6b597ed1c456c39d4 (patch)
treec2f2344c757fffba5b6cc190e6ed13ef64b89266 /source3/lib/talloc.c
parent31c3f7a8b2ff62d4cfc1ed9d831b95eba0da525f (diff)
downloadsamba-484a7c0341fe033fe26fe1e6b597ed1c456c39d4.tar.gz
samba-484a7c0341fe033fe26fe1e6b597ed1c456c39d4.tar.bz2
samba-484a7c0341fe033fe26fe1e6b597ed1c456c39d4.zip
move to SAFE_FREE()
(This used to be commit 60e907b7e8e1c008463a88ed2b076344278986ef)
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. */