summaryrefslogtreecommitdiff
path: root/source4/lib/talloc.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-28 23:30:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:29 -0500
commitfacfe8867d0f69f194d375a81f54dcb4eb91334e (patch)
treee7f574520969b85d1f36e4f0ee66c38377c97adf /source4/lib/talloc.c
parent361f7cc31e4f06ea0ef7ec93158484bef06e221a (diff)
downloadsamba-facfe8867d0f69f194d375a81f54dcb4eb91334e.tar.gz
samba-facfe8867d0f69f194d375a81f54dcb4eb91334e.tar.bz2
samba-facfe8867d0f69f194d375a81f54dcb4eb91334e.zip
r2742: - fixed a bug in talloc_unreference()
- made the LOCAL-TALLOC smbtorture test much stricter, checking that block counts for every pointer are correct after every operation (This used to be commit 18d3e2647f0bedbba699d1ba2649c0cfe4526ef6)
Diffstat (limited to 'source4/lib/talloc.c')
-rw-r--r--source4/lib/talloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/lib/talloc.c b/source4/lib/talloc.c
index 4b796fbbd0..b81cf7221b 100644
--- a/source4/lib/talloc.c
+++ b/source4/lib/talloc.c
@@ -196,8 +196,8 @@ void *talloc_unreference(const void *context, const void *ptr)
}
for (h=tc->refs;h;h=h->next) {
- const void *parent = talloc_parent_chunk(h);
- if (parent == context) break;
+ struct talloc_chunk *p = talloc_parent_chunk(h);
+ if ((p==NULL && context==NULL) || p+1 == context) break;
}
if (h == NULL) {
return NULL;
@@ -526,7 +526,7 @@ off_t talloc_total_size(const void *ptr)
/*
return the total number of blocks in a talloc pool (subtree)
*/
-static off_t talloc_total_blocks(const void *ptr)
+off_t talloc_total_blocks(const void *ptr)
{
off_t total = 0;
struct talloc_chunk *c, *tc = talloc_chunk_from_ptr(ptr);