]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix refcounting of sip_pvt in test_sip_rtpqos test and unlink it from the list of...
authorMark Michelson <mmichelson@digium.com>
Tue, 20 Aug 2013 16:13:01 +0000 (16:13 +0000)
committerMark Michelson <mmichelson@digium.com>
Tue, 20 Aug 2013 16:13:01 +0000 (16:13 +0000)
(closes issue ASTERISK-22248)
reported by Corey Farrell
patches:
test_sip_rtpqos.patch uploaded by Corey Farrell (license #5909)

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

channels/chan_sip.c
channels/sip/dialplan_functions.c

index e2c5d0700fba541a3eb33f05ee19c39abeda2c93..97838b7b70df9f4549061b6879cfd5c3487d565f 100644 (file)
@@ -216,6 +216,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include <regex.h>
 #include <inttypes.h>
 
+#define REF_DEBUG 1
 #include "asterisk/network.h"
 #include "asterisk/paths.h"    /* need ast_config_AST_SYSTEM_NAME */
 /*
index d98fe7d6611042a214f187543611d16c02d23bec..7b0929f22c2e4083f835f2065a54ec304a05ceee 100644 (file)
@@ -353,7 +353,7 @@ AST_TEST_DEFINE(test_sip_rtpqos_1)
                goto done;
        }
        chan->tech = &sip_tech;
-       chan->tech_pvt = p;
+       chan->tech_pvt = dialog_ref(p, "Give the owner channel a reference to the dialog");
        p->owner = chan;
 
        varstr = ast_str_create(16);
@@ -397,8 +397,9 @@ done:
        ast_free(varstr);
        ast_free(buffer);
 
-       /* This unref will take care of destroying the channel, RTP instance, and SIP pvt */
+       /* This unlink and unref will take care of destroying the channel, RTP instance, and SIP pvt */
        if (p) {
+               dialog_unlink_all(p);
                dialog_unref(p, "Destroy test object");
        }
        ast_rtp_engine_unregister(&test_engine);