]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
CID 1214210: mod_ssml - resource leak when parsing SSML
authorChris Rienzo <chris.rienzo@grasshopper.com>
Thu, 15 May 2014 15:31:04 +0000 (11:31 -0400)
committerChris Rienzo <chris.rienzo@grasshopper.com>
Thu, 15 May 2014 15:31:20 +0000 (11:31 -0400)
src/mod/formats/mod_ssml/mod_ssml.c

index ac7a01c2886f257ed67552636634d7373a73159e..d466b8f6b89521c2aea076826755e3b9c76b873f 100644 (file)
@@ -604,10 +604,10 @@ static int tag_hook(void *user_data, char *name, char **atts, int type)
 {
        int result = IKS_OK;
        struct ssml_parser *parsed_data = (struct ssml_parser *)user_data;
-       struct ssml_node *new_node = malloc(sizeof *new_node);
        struct ssml_node *parent_node = parsed_data->cur_node;
 
        if (type == IKS_OPEN || type == IKS_SINGLE) {
+               struct ssml_node *new_node = malloc(sizeof *new_node);
                if (parent_node) {
                        /* inherit parent attribs */
                        *new_node = *parent_node;