]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for mod_ssml
authorAndrey Volk <andywolk@gmail.com>
Fri, 12 Jul 2019 16:12:04 +0000 (20:12 +0400)
committerAndrey Volk <andywolk@gmail.com>
Mon, 15 Jul 2019 19:40:55 +0000 (23:40 +0400)
src/mod/formats/mod_ssml/mod_ssml.c

index ec74c23f492098684d61b9f2308cffab04cf4ffb..85f5ec05567093b5f4a08ae7c35bb351334121ec 100644 (file)
@@ -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)) {