summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-04-15 22:11:44 +0200
committerJeremy Allison <jra@samba.org>2013-04-18 11:36:28 -0700
commitccf33dd0547f32104041c8611626f3e02e22cbe9 (patch)
treed5373724d27ffd902fd8459ce07736efdf2e5692
parentd3928b0c8af01f7751191b81a72590ca35751a8c (diff)
downloadsamba-ccf33dd0547f32104041c8611626f3e02e22cbe9.tar.gz
samba-ccf33dd0547f32104041c8611626f3e02e22cbe9.tar.bz2
samba-ccf33dd0547f32104041c8611626f3e02e22cbe9.zip
talloc: Avoid some "else" by doing early returns
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-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 d0c81d3d43..011e8f3343 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;
}