diff options
author | Corey Farrell <git@cfware.com> | 2017-11-06 18:38:35 -0500 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2017-11-06 18:38:35 -0500 |
commit | 4016884ef3b881379ef762499bd3ef2b40c6f641 (patch) | |
tree | 05a42cad3f918370e47ec4bc9e9bc7969423aed5 /res | |
parent | 637b37fb980822f50966f5292a786d03a859cd89 (diff) |
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
Diffstat (limited to 'res')
-rw-r--r-- | res/res_stasis_playback.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/res/res_stasis_playback.c b/res/res_stasis_playback.c index c6f21365b..ca0446b89 100644 --- a/res/res_stasis_playback.c +++ b/res/res_stasis_playback.c @@ -497,7 +497,11 @@ struct stasis_app_playback *stasis_app_control_play_uri( /* 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) { |