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

Corey Farrell asteriskteam at digium.com
Mon Nov 6 15:41:20 CST 2017


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


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/46/7046/1

diff --git a/main/stream.c b/main/stream.c
index 72d8599..fa7387b 100644
--- a/main/stream.c
+++ b/main/stream.c
@@ -398,7 +398,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/7046
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c0d12755743eadba1357f6153526cc055592856
Gerrit-Change-Number: 7046
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/a3496bb9/attachment.html>


More information about the asterisk-code-review mailing list