diff options
author | Volker Lendecke <vl@samba.org> | 2013-04-15 22:12:50 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2015-03-15 22:14:07 +0100 |
commit | 18285059101b34d125149602954c105dcb0d8e7e (patch) | |
tree | 3ba4e591f7b2c699f7e3da469261dd4593e5bb1f | |
parent | 5c2eadec328d966d33be806dea8885ff44b24487 (diff) | |
download | samba-18285059101b34d125149602954c105dcb0d8e7e.tar.gz |
talloc: Do an early return
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit a796e48b1dfe96b194f3a3a0d70e25c3ab92690d)
-rw-r--r-- | lib/talloc/talloc.c | 9 |
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; } |