aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-16 20:47:53 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-16 20:47:53 +0000
commit2e83bac9723ede41a224c3d261c4808c533be6be (patch)
tree74ae42a845e71289339116b387dfc8736c22f694 /channels
parent532dac8497cdba9895479ccca131922a161659a8 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@131421 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index db0a72ed8..ef90e17ad 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -3431,6 +3431,12 @@ static int iax2_hangup(struct ast_channel *c)
ast_log(LOG_DEBUG, "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]);
if (option_verbose > 2)