summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-01-10 11:35:17 +0100
committerMichael Adam <obnox@samba.org>2008-02-11 15:07:46 +0100
commit59820dcb43bcb2cbb5aad9d2a4dbeed90cc61d98 (patch)
treee7f342bd4cf44e152c219e6f5139a09e5740c852
parentbdb52e4d58e3e4ce8797050d8e0c2c0ddc1e8e0e (diff)
downloadsamba-59820dcb43bcb2cbb5aad9d2a4dbeed90cc61d98.tar.gz
samba-59820dcb43bcb2cbb5aad9d2a4dbeed90cc61d98.tar.bz2
samba-59820dcb43bcb2cbb5aad9d2a4dbeed90cc61d98.zip
talloc_free_children can only reset pool if it's empty
(This used to be commit 5cc7a638e93e5f3540755b441a99d4fd3c9c7134)
-rw-r--r--source4/lib/talloc/talloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source4/lib/talloc/talloc.c b/source4/lib/talloc/talloc.c
index 9e935b892c..35ed447e45 100644
--- a/source4/lib/talloc/talloc.c
+++ b/source4/lib/talloc/talloc.c
@@ -866,7 +866,8 @@ void talloc_free_children(void *ptr)
}
}
- if (tc->flags & TALLOC_FLAG_POOL) {
+ if ((tc->flags & TALLOC_FLAG_POOL)
+ && (*talloc_pool_objectcount(tc) == 1)) {
tc->pool = ((char *)tc + TC_HDR_SIZE + TALLOC_POOL_HDR_SIZE);
#if defined(DEVELOPER) && defined(VALGRIND_MAKE_MEM_NOACCESS)
VALGRIND_MAKE_MEM_NOACCESS(