summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 011e8f33436..0078b07ca67 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;
}