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
This commit is contained in:
Richard Mudgett
2016-04-13 13:50:04 -05:00
parent 5e388d4188
commit 1e93f3d723
5 changed files with 12 additions and 7 deletions

View File

@@ -808,7 +808,6 @@ int ast_unreal_channel_push_to_bridge(struct ast_channel *ast, struct ast_bridge
/* Impart the semi2 channel into the bridge */
if (ast_bridge_impart(bridge, chan, NULL, features,
AST_BRIDGE_IMPART_CHAN_INDEPENDENT)) {
ast_bridge_features_destroy(features);
ast_channel_unref(chan);
return -1;
}