X-Git-Url: http://git.asterisk.org/gitweb/?p=asterisk%2Fasterisk.git;a=blobdiff_plain;f=apps%2Fconfbridge%2Fconf_chan_announce.c;h=af9688437c69a9536a2c34daca027f8d9e0bdf25;hp=46e074b2064be9d1eafce9373f596607451670e0;hb=a022379107a6c55d5c8ce393d1f5da6691ccac3c;hpb=3d63833bd6c869b7efa383e8dea14be1a6eff998;ds=inline diff --git a/apps/confbridge/conf_chan_announce.c b/apps/confbridge/conf_chan_announce.c index 46e074b..af96884 100644 --- a/apps/confbridge/conf_chan_announce.c +++ b/apps/confbridge/conf_chan_announce.c @@ -172,8 +172,8 @@ void conf_announce_channel_depart(struct ast_channel *chan) int conf_announce_channel_push(struct ast_channel *ast) { struct ast_bridge_features *features; + struct ast_channel *chan; RAII_VAR(struct announce_pvt *, p, NULL, ao2_cleanup); - RAII_VAR(struct ast_channel *, chan, NULL, ast_channel_unref); { SCOPED_CHANNELLOCK(lock, ast); @@ -192,12 +192,15 @@ int conf_announce_channel_push(struct ast_channel *ast) features = ast_bridge_features_new(); if (!features) { + ast_channel_unref(chan); return -1; } ast_set_flag(&features->feature_flags, AST_BRIDGE_CHANNEL_FLAG_IMMOVABLE); /* Impart the output channel into the bridge */ if (ast_bridge_impart(p->bridge, chan, NULL, features, 0)) { + ast_bridge_features_destroy(features); + ast_channel_unref(chan); return -1; } ao2_lock(p);