git.samba.org
/
metze
/
samba
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
63bcd07
)
talloc: call return after abort, because an overloaded abort function might not exit
author
Stefan Metzmacher
<metze@samba.org>
Tue, 14 Jul 2009 09:56:33 +0000
(11:56 +0200)
committer
Stefan Metzmacher
<metze@samba.org>
Fri, 24 Jul 2009 08:31:56 +0000
(10:31 +0200)
This will be useful in the testsuite,
where we could check if an abort would happen.
metze
lib/talloc/talloc.c
patch
|
blob
|
history
diff --git
a/lib/talloc/talloc.c
b/lib/talloc/talloc.c
index a1b158a42cd129674d1d0854ce43a96638853edb..dedf98a1a69d588083946a5bc2dc7c7673a25ec6 100644
(file)
--- a/
lib/talloc/talloc.c
+++ b/
lib/talloc/talloc.c
@@
-172,8
+172,10
@@
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 & TALLOC_FLAG_FREE) {
talloc_abort_double_free();
+ return NULL;
} else {
talloc_abort_unknown_value();
+ return NULL;
}
}
return tc;
@@
-581,6
+583,7
@@
static inline int _talloc_free(void *ptr)
if (*pool_object_count == 0) {
talloc_abort("Pool object count zero!");
+ return 0;
}
*pool_object_count -= 1;