]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
astobj2: Correct REF_DEBUG false leak report
authorCorey Farrell <git@cfware.com>
Tue, 7 Oct 2014 21:28:33 +0000 (21:28 +0000)
committerCorey Farrell <git@cfware.com>
Tue, 7 Oct 2014 21:28:33 +0000 (21:28 +0000)
When ao2_callback is run with OBJ_MULTIPLE and not OBJ_NODATA
it allocates a temporary container in a way that does not
record REF_DEBUG log entries.  This changes that container
to correctly record unref's when the container is freed.

ASTERISK-24390 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4047/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@424786 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/astobj2.c

index 70b8b6962c4ddd5b7777c8b5aa165803ad1e040c..01702870348fe8a11169533a9f3491361468e76f 100644 (file)
@@ -623,7 +623,7 @@ static void *internal_ao2_callback(struct ao2_container *c,
                 * is destroyed, the container will be automatically
                 * destroyed as well.
                 */
-               if (!(multi_container = __ao2_container_alloc(1, NULL, NULL))) {
+               if (!(multi_container = ao2_container_alloc(1, NULL, NULL))) {
                        return NULL;
                }
                if (!(multi_iterator = ast_calloc(1, sizeof(*multi_iterator)))) {