From: Russell Bryant Date: Wed, 16 Jul 2008 20:48:27 +0000 (+0000) Subject: Merged revisions 131421 via svnmerge from X-Git-Tag: 1.6.2.0-beta1~1666 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2842b71a325d80f3234bf7e817bef5d20b603b69;p=thirdparty%2Fasterisk.git Merged revisions 131421 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r131421 | russell | 2008-07-16 15:47:53 -0500 (Wed, 16 Jul 2008) | 7 lines Always ensure that the channel's tech_pvt reference is NULL after calling the destroy callback. (closes issue #13060) Reported by: jpgrayson Patches: chan_iax2_tech_pvt_crash.patch uploaded by jpgrayson (license 492) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131422 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 8745080284..06404dd0ac 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -3738,6 +3738,12 @@ static int iax2_hangup(struct ast_channel *c) ast_debug(1, "Really destroying %s now...\n", c->name); iax2_destroy(callno); } + } else if (c->tech_pvt) { + /* If this call no longer exists, but the channel still + * references it we need to set the channel's tech_pvt to null + * to avoid ast_channel_free() trying to free it. + */ + c->tech_pvt = NULL; } ast_mutex_unlock(&iaxsl[callno]); ast_verb(3, "Hungup '%s'\n", c->name);