From: Scott Griepentrog Date: Fri, 19 Dec 2014 17:27:25 +0000 (+0000) Subject: bridge: avoid leaking channel during blond transfer X-Git-Tag: 14.0.0-beta1~1375 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07d10123838af4cac65f0378ab96a46d5d5421e4;p=thirdparty%2Fasterisk.git bridge: avoid leaking channel during blond transfer After a blond transfer (start attended and hang up) to a destination that also hangs up without answer, the Local;1 channel was leaked and would show up on core show channels. This was happening because the attended state blond_nonfinal_enter() resetting the props->transfer_target to null while releasing it's own reference, which would later prevent props from releasing another reference during destruction. The change made here is simply to not assign the target to NULL. ASTERISK-24513 #close Reported by: Mark Michelson Review: https://reviewboard.asterisk.org/r/4262/ ........ Merged revisions 429826 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 429827 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429828 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/bridge_basic.c b/main/bridge_basic.c index 084212b320..b5305a61fa 100644 --- a/main/bridge_basic.c +++ b/main/bridge_basic.c @@ -2263,7 +2263,8 @@ static int blond_nonfinal_enter(struct attended_transfer_properties *props) props->superstate = SUPERSTATE_RECALL; props->recall_target = ast_channel_ref(props->transfer_target); res = blond_enter(props); - props->transfer_target = ast_channel_unref(props->transfer_target); + /* transfer properties holds a separate reference to transfer_target, don't set it to NULL here */ + ast_channel_unref(props->transfer_target); return res; }