summaryrefslogtreecommitdiff
path: root/main/astobj2_hash.c
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2015-04-22 16:17:53 -0400
committerCorey Farrell <git@cfware.com>2015-04-22 20:44:56 -0400
commit73efb093b8cd1a81cee5f9fb0120ac7f74a82ea4 (patch)
treee83bcf6fd66809da64bcc6b266341360bb411299 /main/astobj2_hash.c
parentb0e929219b40f134a925d68dbd764910e3389f3e (diff)
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
Diffstat (limited to 'main/astobj2_hash.c')
-rw-r--r--main/astobj2_hash.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/astobj2_hash.c b/main/astobj2_hash.c
index 37d4b6017..066999f49 100644
--- a/main/astobj2_hash.c
+++ b/main/astobj2_hash.c
@@ -186,6 +186,8 @@ static void hash_ao2_node_destructor(void *v_doomed)
* same node.
*/
my_container = (struct ao2_container_hash *) doomed->common.my_container;
+ ast_assert(is_ao2_object(my_container));
+
__adjust_lock(my_container, AO2_LOCK_REQ_WRLOCK, 1);
#if defined(AO2_DEBUG)