mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-06 05:02:29 +00:00
Astobj2: Ensure all calls to __adjust_lock pass a valid object.
__adjust_lock doesn't check for invalid objects, and doesn't have an appropriate return value for invalid objects. Most callers of __adjust_lock pass objects that have already been confirmed valid, this change adds checks before the remaining calls. ASTERISK-24997 #close Reported by: Corey Farrell Change-Id: I669100f87937cc3f867cec56a27ae9c01292908f
This commit is contained in:
@@ -878,6 +878,8 @@ static void rb_ao2_node_destructor(void *v_doomed)
|
||||
* same node.
|
||||
*/
|
||||
my_container = (struct ao2_container_rbtree *) doomed->common.my_container;
|
||||
ast_assert(is_ao2_object(my_container));
|
||||
|
||||
__adjust_lock(my_container, AO2_LOCK_REQ_WRLOCK, 1);
|
||||
|
||||
#if defined(AO2_DEBUG)
|
||||
|
Reference in New Issue
Block a user