mirror of
https://github.com/asterisk/asterisk.git
synced 2026-06-28 11:19:11 -07:00
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/trunk@222298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user