]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
REF_DEBUG: Prevent logging of container node objects. 59/3159/1
authorCorey Farrell <git@cfware.com>
Thu, 7 Jul 2016 17:41:25 +0000 (13:41 -0400)
committerCorey Farrell <git@cfware.com>
Thu, 7 Jul 2016 17:41:25 +0000 (13:41 -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 1cd6ee249075dbd3fb6c62040aa98ee916dc9b4e..341ff79e06a9c8babb3dacad5e1ad83cbab27df7 100644 (file)
@@ -298,7 +298,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_ref(node, -1);
                                        return AO2_CONTAINER_INSERT_NODE_OBJ_REPLACED;
                                }
                        }
@@ -331,7 +331,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_ref(node, -1);
                                        return AO2_CONTAINER_INSERT_NODE_OBJ_REPLACED;
                                }
                        }
index d8195d47f51ef239c3ad11047929e71a39326353..a8d5e3ac1bc0c954bfaadd5366991c5263f8b5c0 100644 (file)
@@ -1267,7 +1267,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_ref(node, -1);
                return AO2_CONTAINER_INSERT_NODE_OBJ_REPLACED;
        }