diff options
author | Volker Lendecke <vl@samba.org> | 2013-04-15 22:12:50 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2013-04-18 11:36:44 -0700 |
commit | a796e48b1dfe96b194f3a3a0d70e25c3ab92690d (patch) | |
tree | 4361d5616bde8b5e4bf96dc9c41af87b8d2f5a93 /lib/talloc | |
parent | ccf33dd0547f32104041c8611626f3e02e22cbe9 (diff) | |
download | samba-a796e48b1dfe96b194f3a3a0d70e25c3ab92690d.tar.gz samba-a796e48b1dfe96b194f3a3a0d70e25c3ab92690d.tar.bz2 samba-a796e48b1dfe96b194f3a3a0d70e25c3ab92690d.zip |
talloc: Do an early return
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/talloc')
-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 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; } |