Skip to content
Snippets Groups Projects
Commit e0f56566 authored by Walter Doekes's avatar Walter Doekes
Browse files

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
parent de3678c9
No related branches found
No related tags found
No related merge requests found
...@@ -24932,10 +24932,12 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, ...@@ -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, if (ast_bridge_impart(bridge, c, replaces_chan, NULL,
AST_BRIDGE_IMPART_CHAN_INDEPENDENT)) { AST_BRIDGE_IMPART_CHAN_INDEPENDENT)) {
ast_hangup(c); ast_hangup(c);
ast_channel_unref(c);
} }
} else { } else {
ast_channel_move(replaces_chan, c); ast_channel_move(replaces_chan, c);
ast_hangup(c); ast_hangup(c);
ast_channel_unref(c);
} }
sip_pvt_lock(p); sip_pvt_lock(p);
return 0; return 0;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment