summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/talloc/talloc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c
index 011e8f3343..0078b07ca6 100644
--- a/lib/talloc/talloc.c
+++ b/lib/talloc/talloc.c
@@ -931,10 +931,13 @@ static inline int _talloc_free_internal(void *ptr, const char *location)
}
pool->hdr.object_count--;
- if (unlikely(pool->hdr.object_count == 0)) {
- TC_INVALIDATE_FULL_CHUNK(tc);
- free(tc);
+
+ if (likely(pool->hdr.object_count != 0)) {
+ return 0;
}
+
+ TC_INVALIDATE_FULL_CHUNK(tc);
+ free(tc);
return 0;
}