]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix xmldoc memory leak
authorKinsey Moore <kmoore@digium.com>
Tue, 20 Aug 2013 14:25:30 +0000 (14:25 +0000)
committerKinsey Moore <kmoore@digium.com>
Tue, 20 Aug 2013 14:25:30 +0000 (14:25 +0000)
This fixes a single-attribute memory leak that was occurring when the
"required" attribute was not true.

(closes issue ASTERISK-22249)
Reported by: Corey Farrell
Tested by: Corey Farrell
Patches:
    xmldoc-free_attr_required.patch uploaded by Corey Farrell
........

Merged revisions 397064 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@397067 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/xmldoc.c

index f537e06c824e8b5da94eb009c25cf21bcec3405d..18afbb6368d1b478c3e6b2d2a089b5a7ede7db3b 100644 (file)
@@ -759,6 +759,7 @@ static char *xmldoc_get_syntax_fun(struct ast_xml_node *rootnode, const char *ro
                                if ((paramtype = ast_xml_get_attribute(node, "required"))) {
                                        if (!ast_true(paramtype)) {
                                                optmidnode = 1;
+                                               ast_xml_free_attr(paramtype);
                                                break;
                                        }
                                        ast_xml_free_attr(paramtype);