Simple lock, assignment, unlock sandwich optimization.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2013-06-04 22:51:04 +00:00
parent cc97274d3b
commit dcf5990c56

View File

@@ -18,7 +18,7 @@
/*! \file
*
* \brief Native RTP bridging module
* \brief Native RTP bridging technology module
*
* \author Joshua Colp <jcolp@digium.com>
*
@@ -251,15 +251,13 @@ static int native_rtp_bridge_framehook_attach(struct ast_bridge_channel *bridge_
}
ast_channel_lock(bridge_channel->chan);
if (!(data->id = ast_framehook_attach(bridge_channel->chan, &hook)) < 0) {
ast_channel_unlock(bridge_channel->chan);
data->id = ast_framehook_attach(bridge_channel->chan, &hook);
ast_channel_unlock(bridge_channel->chan);
if (!data->id < 0) {
ao2_cleanup(data);
return -1;
}
ast_channel_unlock(bridge_channel->chan);
bridge_channel->bridge_pvt = data;
return 0;