diff --git a/bridges/bridge_native_rtp.c b/bridges/bridge_native_rtp.c index 3c8e57c935..120a509c1c 100644 --- a/bridges/bridge_native_rtp.c +++ b/bridges/bridge_native_rtp.c @@ -155,7 +155,10 @@ static int native_rtp_bridge_compatible(struct ast_bridge *bridge) struct ast_bridge_channel *c1 = AST_LIST_LAST(&bridge->channels); enum ast_rtp_glue_result native_type; struct ast_rtp_glue *glue0, *glue1; - struct ast_rtp_instance *instance0 = NULL, *instance1 = NULL, *vinstance0 = NULL, *vinstance1 = NULL; + RAII_VAR(struct ast_rtp_instance *, instance0, NULL, ao2_cleanup); + RAII_VAR(struct ast_rtp_instance *, instance1, NULL, ao2_cleanup); + RAII_VAR(struct ast_rtp_instance *, vinstance0, NULL, ao2_cleanup); + RAII_VAR(struct ast_rtp_instance *, vinstance1, NULL, ao2_cleanup); RAII_VAR(struct ast_format_cap *, cap0, ast_format_cap_alloc_nolock(), ast_format_cap_destroy); RAII_VAR(struct ast_format_cap *, cap1, ast_format_cap_alloc_nolock(), ast_format_cap_destroy); int read_ptime0, read_ptime1, write_ptime0, write_ptime1; diff --git a/main/stasis_channels.c b/main/stasis_channels.c index 8327384d7a..badcca2433 100644 --- a/main/stasis_channels.c +++ b/main/stasis_channels.c @@ -120,6 +120,7 @@ static void channel_snapshot_dtor(void *obj) { struct ast_channel_snapshot *snapshot = obj; ast_string_field_free_memory(snapshot); + ao2_cleanup(snapshot->manager_vars); } struct ast_channel_snapshot *ast_channel_snapshot_create(struct ast_channel *chan) @@ -199,8 +200,8 @@ void ast_channel_publish_dial(struct ast_channel *caller, struct ast_channel *pe RAII_VAR(struct ast_multi_channel_blob *, payload, NULL, ao2_cleanup); RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup); RAII_VAR(struct ast_json *, blob, NULL, ast_json_unref); - struct ast_channel_snapshot *caller_snapshot; - struct ast_channel_snapshot *peer_snapshot; + RAII_VAR(struct ast_channel_snapshot *, caller_snapshot, NULL, ao2_cleanup); + RAII_VAR(struct ast_channel_snapshot *, peer_snapshot, NULL, ao2_cleanup); ast_assert(peer != NULL); blob = ast_json_pack("{s: s, s: s}",