]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Always ensure that the channel's tech_pvt reference is NULL after calling the
authorRussell Bryant <russell@russellbryant.com>
Wed, 16 Jul 2008 20:47:53 +0000 (20:47 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 16 Jul 2008 20:47:53 +0000 (20:47 +0000)
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/branches/1.4@131421 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index db0a72ed82f9883a6cbed05e6d31f12903599e32..ef90e17ad9dc919aaac6d16b8f23ef3032a71913 100644 (file)
@@ -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)