diff options
author | Walter Doekes <walter+asterisk@wjd.nu> | 2015-07-02 16:08:12 +0200 |
---|---|---|
committer | Walter Doekes <walter+asterisk@wjd.nu> | 2015-07-02 16:12:32 +0200 |
commit | e0f565663b49e14c15d7b5e6e9ff7396956b91f6 (patch) | |
tree | 0a780d8c80bb06e1d35c35c4e9259ed113c17510 /channels | |
parent | de3678c92e57083c1332eabf129cd1551dd0b625 (diff) |
chan_sip: Fix early call pickup channel leak.
When handle_invite_replaces() was called, and either ast_bridge_impart()
failed or there was no bridge (because the channel we're picking up was
still ringing), chan_sip would leak a channel.
Thanks Matt and Corey for checking the bridge path.
ASTERISK-25226 #close
Change-Id: Ie736bb182170a73eef5bcef0ab0376f645c260c8
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 30cb20de8..1838bdaad 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -24932,10 +24932,12 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, if (ast_bridge_impart(bridge, c, replaces_chan, NULL, AST_BRIDGE_IMPART_CHAN_INDEPENDENT)) { ast_hangup(c); + ast_channel_unref(c); } } else { ast_channel_move(replaces_chan, c); ast_hangup(c); + ast_channel_unref(c); } sip_pvt_lock(p); return 0; |