summaryrefslogtreecommitdiff
path: root/channels/sip
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-03-15 14:51:25 -0500
committerRichard Mudgett <rmudgett@digium.com>2016-03-16 14:22:19 -0500
commit0987a11cce90da40f5a6bec4646474c34dc55bc2 (patch)
tree7f17983176e84f1803882af8974c7672cf31d108 /channels/sip
parent9a7cfa2b61d90bc229d478b669833a6caf19b0c1 (diff)
sip/dialplan_functions.c: Fix /channels/chan_sip/test_sip_rtpqos crash.
This patch is part of a series to resolve deadlocks in chan_sip.c. Delaying destruction of the chan_sip sip_pvt structures caused the /channels/chan_sip/test_sip_rtpqos unit test to crash. That test registers a special test ast_rtp_engine with the rtp engine module. When the unit test completes it cleans up by unregistering the test ast_rtp_engine and exits. Since the delayed destruction of the sip_pvt happens after the unit test returns, the destructor tries to call the rtp engine destroy callback of the test ast_rtp_engine auto variable which no longer exists on the stack. * Change the test ast_rtp_engine auto variable to a static variable. Now the variable can still exist after the unit test exits so the delayed sip_pvt destruction can complete successfully. ASTERISK-25023 Change-Id: I61e34a12d425189ef7e96fc69ae14993f82f3f13
Diffstat (limited to 'channels/sip')
-rw-r--r--channels/sip/dialplan_functions.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/channels/sip/dialplan_functions.c b/channels/sip/dialplan_functions.c
index 33ba71c27..644da3852 100644
--- a/channels/sip/dialplan_functions.c
+++ b/channels/sip/dialplan_functions.c
@@ -273,7 +273,7 @@ static int test_sip_rtpqos_1_get_stat(struct ast_rtp_instance *instance, struct
AST_TEST_DEFINE(test_sip_rtpqos_1)
{
int i, res = AST_TEST_PASS;
- struct ast_rtp_engine test_engine = {
+ static struct ast_rtp_engine test_engine = {
.name = "test",
.new = test_sip_rtpqos_1_new,
.destroy = test_sip_rtpqos_1_destroy,