From: Chris Rienzo Date: Thu, 15 May 2014 15:31:04 +0000 (-0400) Subject: CID 1214210: mod_ssml - resource leak when parsing SSML X-Git-Tag: v1.4.4~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7b14209eb2619dc5a2a8ca94234289b960269f5;p=thirdparty%2Ffreeswitch.git CID 1214210: mod_ssml - resource leak when parsing SSML --- diff --git a/src/mod/formats/mod_ssml/mod_ssml.c b/src/mod/formats/mod_ssml/mod_ssml.c index 0ca4bc911b..be0857c482 100644 --- a/src/mod/formats/mod_ssml/mod_ssml.c +++ b/src/mod/formats/mod_ssml/mod_ssml.c @@ -616,10 +616,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;