aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_dahdi.c
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-06 19:24:59 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-06 19:24:59 +0000
commit074498cb9b2733967ea2c39d7b9e2a2db2f0ed27 (patch)
tree9bf9634723c707eb30086e4484ab57c0ff4bae3b /channels/chan_dahdi.c
parent2d756b1cc75355905a78a9c7913ce47b634c01f3 (diff)
Fix crash during destruction of second channel when variable set with setvar.
The setvar line in chan_dahdi.conf is shared among all the channels, so make sure to only free the resources only when the last channel is destroyed. (closes issue #15899) Reported by: tzafrir git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222298 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r--channels/chan_dahdi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 8a43bacad..0af7d7d4b 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -4881,8 +4881,9 @@ static void destroy_dahdi_pvt(struct dahdi_pvt *pvt)
ast_smdi_interface_unref(p->smdi_iface);
if (p->mwi_event_sub)
ast_event_unsubscribe(p->mwi_event_sub);
- if (p->vars)
+ if (p->vars && iflist && !iflist->next) {
ast_variables_destroy(p->vars);
+ }
ast_mutex_destroy(&p->lock);
dahdi_close_sub(p, SUB_REAL);
if (p->owner)