summaryrefslogtreecommitdiff
path: root/lib/talloc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/talloc')
-rw-r--r--lib/talloc/talloc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c
index 8e91b60c99..a65a69b4e2 100644
--- a/lib/talloc/talloc.c
+++ b/lib/talloc/talloc.c
@@ -1211,7 +1211,9 @@ size_t talloc_total_size(const void *ptr)
tc->flags |= TALLOC_FLAG_LOOP;
- total = tc->size;
+ if (likely(tc->name != TALLOC_MAGIC_REFERENCE)) {
+ total = tc->size;
+ }
for (c=tc->child;c;c=c->next) {
total += talloc_total_size(TC_PTR_FROM_CHUNK(c));
}