Fix xmldoc memory leak

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@397064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2013-08-20 14:24:52 +00:00
parent 3422dd98a5
commit 4b007c059f

View File

@@ -755,6 +755,7 @@ static char *xmldoc_get_syntax_fun(struct ast_xml_node *rootnode, const char *ro
if ((paramtype = ast_xml_get_attribute(node, "required"))) { if ((paramtype = ast_xml_get_attribute(node, "required"))) {
if (!ast_true(paramtype)) { if (!ast_true(paramtype)) {
optmidnode = 1; optmidnode = 1;
ast_xml_free_attr(paramtype);
break; break;
} }
ast_xml_free_attr(paramtype); ast_xml_free_attr(paramtype);