[Asterisk-code-review] main/sdp state: Check for errors from ast stream topology se... (asterisk[15])

Richard Mudgett asteriskteam at digium.com
Tue Dec 19 17:14:28 CST 2017


Richard Mudgett has uploaded this change for review. ( https://gerrit.asterisk.org/7672


Change subject: main/sdp_state: Check for errors from ast_stream_topology_set_stream.
......................................................................

main/sdp_state: Check for errors from ast_stream_topology_set_stream.

Change-Id: I84a83ae69daba5d185cc1d939b133a4c23565497
---
M main/sdp_state.c
1 file changed, 12 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/72/7672/1

diff --git a/main/sdp_state.c b/main/sdp_state.c
index a77d96d..2b75cc2 100644
--- a/main/sdp_state.c
+++ b/main/sdp_state.c
@@ -1255,7 +1255,10 @@
 					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 @@
 		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 @@
 		}
 
 		/* 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;
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/7672
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: I84a83ae69daba5d185cc1d939b133a4c23565497
Gerrit-Change-Number: 7672
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171219/a0ec48fb/attachment.html>


More information about the asterisk-code-review mailing list