diff options
author | Joshua Colp <jcolp@digium.com> | 2017-11-09 03:43:35 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-11-09 03:43:35 -0600 |
commit | c32710386e80bd3c2041e7b1516b9368bf0c0314 (patch) | |
tree | daf52ac83b404d1188888f539c9931afed6f3b7b | |
parent | 47d484835853462f3f65bc70312c64e1644e2148 (diff) | |
parent | 9b3db9a7fd86544ecec79b226aa4c6687a52c7cf (diff) |
Merge "main/sdp_state: Check for errors from ast_stream_topology_set_stream."
-rw-r--r-- | main/sdp_state.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/main/sdp_state.c b/main/sdp_state.c index a77d96da5..2b75cc2a1 100644 --- a/main/sdp_state.c +++ b/main/sdp_state.c @@ -1255,7 +1255,10 @@ static int sdp_merge_streams_match( return -1; } idx = AST_VECTOR_GET(current_vect, current_idx); - ast_stream_topology_set_stream(merged_topology, idx, merged_stream); + if (ast_stream_topology_set_stream(merged_topology, idx, merged_stream)) { + ast_stream_free(merged_stream); + return -1; + } /* * The current_stream cannot be considered a backfill_candidate @@ -1400,7 +1403,10 @@ static struct ast_stream_topology *merge_local_topologies( if (!merged_stream) { goto fail; } - ast_stream_topology_set_stream(merged_topology, idx, merged_stream); + if (ast_stream_topology_set_stream(merged_topology, idx, merged_stream)) { + ast_stream_free(merged_stream); + goto fail; + } } /* Backfill new update stream slots into pre-existing declined current stream slots */ @@ -1438,7 +1444,10 @@ static struct ast_stream_topology *merge_local_topologies( } /* Add the new stream into the backfill stream slot. */ - ast_stream_topology_set_stream(merged_topology, current_idx, merged_stream); + if (ast_stream_topology_set_stream(merged_topology, current_idx, merged_stream)) { + ast_stream_free(merged_stream); + goto fail; + } backfill_candidate[current_idx] = 0; } |