summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-04-13 13:50:04 -0500
committerRichard Mudgett <rmudgett@digium.com>2016-04-22 15:45:47 -0500
commita63656b41975a4f77c8d953b5dc7f966332892f4 (patch)
tree74d852cbee1a1b01c2205e68f767e8970e6998bf /include
parent71dfa355403e41850fd7c4cb4228626e5d9476b9 (diff)
Bridge system: Fix memory leaks and double frees on impart failure.
You cannot reference the passed in features struct after calling ast_bridge_impart(). Even if the call fails. Change-Id: I902b88ba0d5d39520e670fb635078a367268ea21
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/features.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/asterisk/features.h b/include/asterisk/features.h
index b63124c2f..a4aed5d18 100644
--- a/include/asterisk/features.h
+++ b/include/asterisk/features.h
@@ -51,6 +51,7 @@ int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, struct a
/*!
* \brief Bridge a call, and add additional flags to the bridge
*
+ * \details
* This does the same thing as \ref ast_bridge_call, except that once the bridge
* is created, the provided flags are set on the bridge. The provided flags are
* added to the bridge's flags; they will not clear any flags already set.
@@ -70,6 +71,7 @@ int ast_bridge_call_with_flags(struct ast_channel *chan, struct ast_channel *pee
* \brief Add an arbitrary channel to a bridge
* \since 12.0.0
*
+ * \details
* The channel that is being added to the bridge can be in any state: unbridged,
* bridged, answered, unanswered, etc. The channel will be added asynchronously,
* meaning that when this function returns once the channel has been added to
@@ -87,11 +89,16 @@ int ast_bridge_call_with_flags(struct ast_channel *chan, struct ast_channel *pee
* \param features Features for this channel in the bridge
* \param play_tone Indicates if a tone should be played to the channel
* \param xfersound Sound that should be used to indicate transfer with play_tone
+ *
+ * \note The features parameter must be NULL or obtained by
+ * ast_bridge_features_new(). You must not dereference features
+ * after calling even if the call fails.
+ *
* \retval 0 Success
* \retval -1 Failure
*/
int ast_bridge_add_channel(struct ast_bridge *bridge, struct ast_channel *chan,
- struct ast_bridge_features *features, int play_tone, const char *xfersound);
+ struct ast_bridge_features *features, int play_tone, const char *xfersound);