From: Jeff Peeler Date: Tue, 6 Oct 2009 19:26:57 +0000 (+0000) Subject: Merged revisions 222298 via svnmerge from X-Git-Tag: 1.6.1.10-rc1~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c980313a1346dcc7064c23eed83e3dd16204cf6;p=thirdparty%2Fasterisk.git Merged revisions 222298 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r222298 | jpeeler | 2009-10-06 14:24:59 -0500 (Tue, 06 Oct 2009) | 9 lines 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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@222303 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 0f6ac3aad1..11dcf92695 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -3152,8 +3152,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)