diff options
author | Mark Michelson <mmichelson@digium.com> | 2013-08-20 16:25:33 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2013-08-20 16:25:33 +0000 |
commit | 7db29851866c7ce58325d6660814e3c31098eefe (patch) | |
tree | c139cc5a96108fc0f977b8d6a10412fce8c0fa86 /channels | |
parent | 86741bdf465449a40bf329638fdb3374d7023a7c (diff) |
Fix refcounting of sip_pvt in test_sip_rtpqos test and unlink it from the list of pvts.
(closes issue ASTERISK-22248)
reported by Corey Farrell
patches:
test_sip_rtpqos.patch uploaded by Corey Farrell (license #5909)
........
Merged revisions 397112 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 397133 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 1 | ||||
-rw-r--r-- | channels/sip/dialplan_functions.c | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 36291d1ac..e80588df2 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -228,6 +228,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 */ /* diff --git a/channels/sip/dialplan_functions.c b/channels/sip/dialplan_functions.c index 0f43685ff..af69dac45 100644 --- a/channels/sip/dialplan_functions.c +++ b/channels/sip/dialplan_functions.c @@ -353,7 +353,7 @@ AST_TEST_DEFINE(test_sip_rtpqos_1) goto done; } ast_channel_tech_set(chan, &sip_tech); - ast_channel_tech_pvt_set(chan, p); + ast_channel_tech_pvt_set(chan, 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); |