[Asterisk-code-review] res stasis playback: Check for failure to append vector. (asterisk[15])
Corey Farrell
asteriskteam at digium.com
Mon Nov 6 17:39:26 CST 2017
Corey Farrell has uploaded this change for review. ( https://gerrit.asterisk.org/7072
Change subject: res_stasis_playback: Check for failure to append vector.
......................................................................
res_stasis_playback: Check for failure to append vector.
Free resources and return error if we fail to append the vector in
stasis_app_control_play_uri.
Change-Id: I22c4a90dd859b253f2850c6511de48b25609422b
---
M res/res_stasis_playback.c
1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/72/7072/1
diff --git a/res/res_stasis_playback.c b/res/res_stasis_playback.c
index c6f2136..ca0446b 100644
--- a/res/res_stasis_playback.c
+++ b/res/res_stasis_playback.c
@@ -497,7 +497,11 @@
/* safe */
strcpy(media_uri, media[i]);
- AST_VECTOR_APPEND(&playback->medias, media_uri);
+ if (AST_VECTOR_APPEND(&playback->medias, media_uri)) {
+ ao2_ref(playback, -1);
+ ast_free(media_uri);
+ return NULL;
+ }
}
if (skipms == 0) {
--
To view, visit https://gerrit.asterisk.org/7072
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: I22c4a90dd859b253f2850c6511de48b25609422b
Gerrit-Change-Number: 7072
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/0305fda9/attachment.html>
More information about the asterisk-code-review
mailing list