[svn-commits] jpeeler: trunk r222298 - /trunk/channels/chan_dahdi.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Oct 6 14:25:03 CDT 2009


Author: jpeeler
Date: Tue Oct  6 14:24:59 2009
New Revision: 222298

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=222298
Log:
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


Modified:
    trunk/channels/chan_dahdi.c

Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=222298&r1=222297&r2=222298
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Tue Oct  6 14:24:59 2009
@@ -4881,8 +4881,9 @@
 		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)




More information about the svn-commits mailing list