summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-04-15 22:11:44 +0200
committerKarolin Seeger <kseeger@samba.org>2015-03-15 22:14:07 +0100
commit5c2eadec328d966d33be806dea8885ff44b24487 (patch)
tree812eafc7d8cbe99a74acb586cc89f6e26e0a895f
parent61150fb12de1941537154c792a6db4a00f47b6c4 (diff)
downloadsamba-5c2eadec328d966d33be806dea8885ff44b24487.tar.gz
talloc: Avoid some "else" by doing early returns
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit ccf33dd0547f32104041c8611626f3e02e22cbe9)
-rw-r--r--lib/talloc/talloc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c
index d0c81d3d43a..011e8f33436 100644
--- a/lib/talloc/talloc.c
+++ b/lib/talloc/talloc.c
@@ -935,12 +935,16 @@ static inline int _talloc_free_internal(void *ptr, const char *location)
TC_INVALIDATE_FULL_CHUNK(tc);
free(tc);
}
- } else if (tc->flags & TALLOC_FLAG_POOLMEM) {
+ return 0;
+ }
+
+ if (tc->flags & TALLOC_FLAG_POOLMEM) {
_talloc_free_poolmem(tc, location);
- } else {
- TC_INVALIDATE_FULL_CHUNK(tc);
- free(tc);
+ return 0;
}
+
+ TC_INVALIDATE_FULL_CHUNK(tc);
+ free(tc);
return 0;
}