1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-11 16:58:40 +03:00

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
This commit is contained in:
Stefan Metzmacher 2009-07-14 11:56:33 +02:00 committed by Andrew Tridgell
parent 2c664db749
commit 1fbc86c57a

View File

@ -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 (unlikely((tc->flags & (TALLOC_FLAG_FREE | ~0xF)) != TALLOC_MAGIC)) {
if ((tc->flags & (~0xF)) == TALLOC_MAGIC_V1) { if ((tc->flags & (~0xF)) == TALLOC_MAGIC_V1) {
talloc_abort_magic_v1(); talloc_abort_magic_v1();
return NULL;
} }
if (tc->flags & TALLOC_FLAG_FREE) { if (tc->flags & TALLOC_FLAG_FREE) {
talloc_abort_double_free(); talloc_abort_double_free();
return NULL;
} else { } else {
talloc_abort_unknown_value(); talloc_abort_unknown_value();
return NULL;
} }
} }
return tc; return tc;
@ -595,6 +598,7 @@ static inline int _talloc_free_internal(void *ptr)
if (*pool_object_count == 0) { if (*pool_object_count == 0) {
talloc_abort("Pool object count zero!"); talloc_abort("Pool object count zero!");
return 0;
} }
*pool_object_count -= 1; *pool_object_count -= 1;