diff options
author | Matthew Jordan <mjordan@digium.com> | 2014-05-25 02:37:03 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2014-05-25 02:37:03 +0000 |
commit | 09bbfa76ab589a440d954b29b2facc32e0d22248 (patch) | |
tree | 3c2fefc89cfa455e63ecfa5a3079c9eb66964f33 /main/optional_api.c | |
parent | a7d9f2f59506d2b2905c2e03d3ff3ea8d325c919 (diff) |
core_unreal: Prevent double free of core_unreal pvt
When a channel is destroyed (such as via ast_channel_release in off nominal
paths in core_unreal), it will attempt to free (via ast_free) the channel tech
pvt. This is problematic for a few reasons:
1. The channel tech pvt is an ao2 object in core_unreal. Free'ing the pvt
directly is no good.
2. The channel tech pvt's reference count is dropped just prior to calling
ast_channel_release, resulting in the pvt's destruction. Hence, the
channel destructor is free'ing an invalid pointer.
This patch keeps the dropping of the reference count, but sets the pvt to
NULL on the channel prior to releasing it. This models what would occur if the
channel was hung up directly.
........
Merged revisions 414542 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/optional_api.c')
0 files changed, 0 insertions, 0 deletions