From d432f73b759b3d7be4ad34915e3a48aac1546dd6 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 12 Jul 2019 20:12:04 +0400 Subject: [PATCH] FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for mod_ssml --- src/mod/formats/mod_ssml/mod_ssml.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mod/formats/mod_ssml/mod_ssml.c b/src/mod/formats/mod_ssml/mod_ssml.c index ec74c23f49..85f5ec0556 100644 --- a/src/mod/formats/mod_ssml/mod_ssml.c +++ b/src/mod/formats/mod_ssml/mod_ssml.c @@ -620,6 +620,7 @@ static int tag_hook(void *user_data, char *name, char **atts, int type) if (type == IKS_OPEN || type == IKS_SINGLE) { struct ssml_node *new_node = malloc(sizeof *new_node); + switch_assert(new_node); if (parent_node) { /* inherit parent attribs */ *new_node = *parent_node; @@ -741,6 +742,7 @@ static int process_cdata_tts(struct ssml_parser *parsed_data, char *data, size_t /* try macro */ to_say = malloc(len + 1); + switch_assert(to_say); strncpy(to_say, data, len); to_say[len] = '\0'; if (!cur_node->say_macro || !get_file_from_macro(parsed_data, to_say)) {