From facfe8867d0f69f194d375a81f54dcb4eb91334e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 28 Sep 2004 23:30:14 +0000 Subject: 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) --- source4/lib/talloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/lib') 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); -- cgit