[Asterisk-code-review] stream: Free stream on error appending vector. (asterisk[master])

Corey Farrell asteriskteam at digium.com
Mon Nov 6 15:40:44 CST 2017


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


Change subject: stream: Free stream on error appending vector.
......................................................................

stream: Free stream on error appending vector.

Change-Id: I6c0d12755743eadba1357f6153526cc055592856
---
M main/stream.c
1 file changed, 4 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/45/7045/1

diff --git a/main/stream.c b/main/stream.c
index c233b2f..3f8ef6b 100644
--- a/main/stream.c
+++ b/main/stream.c
@@ -415,7 +415,10 @@
 	stream->position = position;
 
 	if (position == AST_VECTOR_SIZE(&topology->streams)) {
-		AST_VECTOR_APPEND(&topology->streams, stream);
+		if (AST_VECTOR_APPEND(&topology->streams, stream)) {
+			ast_stream_free(stream);
+			return -1;
+		}
 		return 0;
 	}
 

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c0d12755743eadba1357f6153526cc055592856
Gerrit-Change-Number: 7045
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/20171106/b99e4ed4/attachment-0001.html>


More information about the asterisk-code-review mailing list