summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-07-14 11:56:33 +0200
committerAndrew Tridgell <tridge@samba.org>2009-08-24 16:29:57 +1000
commit1fbc86c57a60fdb828a50d24c65750ba01b92f10 (patch)
tree2449b88771fbb1ca00138ec16ea41807f4e44a5c /lib
parent2c664db7494da12e1738dbcbdece41374f561661 (diff)
downloadsamba-1fbc86c57a60fdb828a50d24c65750ba01b92f10.tar.gz
samba-1fbc86c57a60fdb828a50d24c65750ba01b92f10.tar.bz2
samba-1fbc86c57a60fdb828a50d24c65750ba01b92f10.zip
talloc: call return after abort, because an overloaded abort function might not exit
This will be useful in the testsuite, where we could check if an abort would happen. metze
Diffstat (limited to 'lib')
-rw-r--r--lib/talloc/talloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c
index a65a69b4e2..a0065bccab 100644
--- a/lib/talloc/talloc.c
+++ b/lib/talloc/talloc.c
@@ -180,12 +180,15 @@ static inline struct talloc_chunk *talloc_chunk_from_ptr(const void *ptr)
if (unlikely((tc->flags & (TALLOC_FLAG_FREE | ~0xF)) != TALLOC_MAGIC)) {
if ((tc->flags & (~0xF)) == TALLOC_MAGIC_V1) {
talloc_abort_magic_v1();
+ return NULL;
}
if (tc->flags & TALLOC_FLAG_FREE) {
talloc_abort_double_free();
+ return NULL;
} else {
talloc_abort_unknown_value();
+ return NULL;
}
}
return tc;
@@ -595,6 +598,7 @@ static inline int _talloc_free_internal(void *ptr)
if (*pool_object_count == 0) {
talloc_abort("Pool object count zero!");
+ return 0;
}
*pool_object_count -= 1;