git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
61150fb
)
talloc: Avoid some "else" by doing early returns
author
Volker Lendecke
<vl@samba.org>
Mon, 15 Apr 2013 20:11:44 +0000
(22:11 +0200)
committer
Karolin Seeger
<kseeger@samba.org>
Sun, 15 Mar 2015 21:14:07 +0000
(22:14 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit
ccf33dd0547f32104041c8611626f3e02e22cbe9
)
lib/talloc/talloc.c
patch
|
blob
|
history
diff --git
a/lib/talloc/talloc.c
b/lib/talloc/talloc.c
index d0c81d3d43a4ba25defcd65b508972d4242c784a..011e8f33436786e2354642a371780323206e3ef0 100644
(file)
--- 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;
}