From: Kinsey Moore Date: Tue, 20 Aug 2013 14:24:52 +0000 (+0000) Subject: Fix xmldoc memory leak X-Git-Tag: 1.8.24.0-rc1~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4b007c059fa87f5ec5ea2bb4c0a4c89cd31845c3;p=thirdparty%2Fasterisk.git 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 --- diff --git a/main/xmldoc.c b/main/xmldoc.c index 8e2a1f13b4..25f1fb6004 100644 --- a/main/xmldoc.c +++ b/main/xmldoc.c @@ -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 (!ast_true(paramtype)) { optmidnode = 1; + ast_xml_free_attr(paramtype); break; } ast_xml_free_attr(paramtype);