[Asterisk-code-review] res pjsip session: Check for ast stream topology append stre... (asterisk[master])

Corey Farrell asteriskteam at digium.com
Tue Nov 7 11:56:19 CST 2017


Corey Farrell has uploaded this change for review. ( https://gerrit.asterisk.org/7107


Change subject: res_pjsip_session: Check for ast_stream_topology_append_stream error.
......................................................................

res_pjsip_session: Check for ast_stream_topology_append_stream error.

Change-Id: I080275c6330d6775e9f8c0e5396d872ae484031e
---
M res/res_pjsip_session.c
1 file changed, 5 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/07/7107/1

diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 4724d46..3c79f49 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -1588,7 +1588,11 @@
 					}
 
 					ast_stream_set_state(cloned, AST_STREAM_STATE_REMOVED);
-					ast_stream_topology_append_stream(media_state->topology, cloned);
+					if (ast_stream_topology_append_stream(media_state->topology, cloned)) {
+						ast_stream_free(cloned);
+						ast_sip_session_media_state_free(media_state);
+						return -1;
+					}
 				}
 
 				/* If the resulting media state matches the existing active state don't bother doing a session refresh */

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I080275c6330d6775e9f8c0e5396d872ae484031e
Gerrit-Change-Number: 7107
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171107/00d33187/attachment.html>


More information about the asterisk-code-review mailing list