REF_DEBUG: Prevent logging of container node objects.
authorCorey Farrell <git@cfware.com>
Thu, 7 Jul 2016 17:44:39 +0000 (13:44 -0400)
committerCorey Farrell <git@cfware.com>
Thu, 7 Jul 2016 17:44:39 +0000 (13:44 -0400)
Using AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE can result in an unref being
recorded to the refs log for the node being replaced.  This prevents
logging of those unrefs since they would produce errors in
refcounter.py.

ASTERISK-26181 #close

Change-Id: Ie4fded84e8a1a58b3a59ce59dfd7eb0da3ddc5d4

main/astobj2_hash.c
main/astobj2_rbtree.c

index b036911..072cd18 100644 (file)
@@ -274,7 +274,7 @@ static enum ao2_container_insert hash_ao2_insert_node(struct ao2_container_hash
                                        break;
                                case AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE:
                                        SWAP(cur->common.obj, node->common.obj);
-                                       ao2_t_ref(node, -1, "Discard the new node.");
+                                       ao2_t_ref(node, -1, NULL);
                                        return AO2_CONTAINER_INSERT_NODE_OBJ_REPLACED;
                                }
                        }
@@ -307,7 +307,7 @@ static enum ao2_container_insert hash_ao2_insert_node(struct ao2_container_hash
                                        break;
                                case AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE:
                                        SWAP(cur->common.obj, node->common.obj);
-                                       ao2_t_ref(node, -1, "Discard the new node.");
+                                       ao2_t_ref(node, -1, NULL);
                                        return AO2_CONTAINER_INSERT_NODE_OBJ_REPLACED;
                                }
                        }
index b06813d..03efd88 100644 (file)
@@ -1243,7 +1243,7 @@ static enum ao2_container_insert rb_ao2_insert_node(struct ao2_container_rbtree
                break;
        case AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE:
                SWAP(cur->common.obj, node->common.obj);
-               ao2_t_ref(node, -1, "Don't need the new node.");
+               ao2_t_ref(node, -1, NULL);
                return AO2_CONTAINER_INSERT_NODE_OBJ_REPLACED;
        }