diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-11-09 22:18:23 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-11-09 22:18:23 +0000 |
commit | 6d1437aed015ab05587c1392c39d5cf03d0d9574 (patch) | |
tree | c9895ab0f1403f7a4f8a8a104db070ab35e162b5 /channels/chan_sip.c | |
parent | ed29861e84b37fafd58028125a997ff4b1daaef9 (diff) |
fixes segfault when transferring a queue caller
In sip_hangup we attempted to lock p->owner after we set it to NULL.
Thanks to fhackenberger for reporting the issue and submitting a patch.
(closes issue 0015848)
Reported by: fhackenberger
Patches:
digium_bug_0015848 uploaded by fhackenberger (license 592)
Tested by: fhackenberger, lmadsen, TomS, shin-shoryuken, dvossel
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@229014 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 0ea34dac3..cdcab1985 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -5674,15 +5674,12 @@ static int sip_hangup(struct ast_channel *ast) * to lock the bridge. This may get hairy... */ while (bridge && ast_channel_trylock(bridge)) { - struct ast_channel *chan = p->owner; sip_pvt_unlock(p); do { - /* Use chan since p->owner could go NULL on us - * while p is unlocked - */ - CHANNEL_DEADLOCK_AVOIDANCE(chan); + /* Use oldowner since p->owner is already NULL */ + CHANNEL_DEADLOCK_AVOIDANCE(oldowner); } while (sip_pvt_trylock(p)); - bridge = p->owner ? ast_bridged_channel(p->owner) : NULL; + bridge = ast_bridged_channel(oldowner); } if (p->rtp) |