From 47a96d1f08578ba143b50a7e83c0338dcebcacc6 Mon Sep 17 00:00:00 2001 From: "sgunderson@bigfoot.com" <> Date: Wed, 21 Sep 2011 23:51:53 +0200 Subject: [PATCH] Fix an id buffer leak in the C++0x code. simple now passes without leaks. --- c++0x/xml-template.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/c++0x/xml-template.cpp b/c++0x/xml-template.cpp index e6e88a3..067bf73 100644 --- a/c++0x/xml-template.cpp +++ b/c++0x/xml-template.cpp @@ -99,7 +99,9 @@ void Substitute::process(xmlNode *node, bool clean) for (xmlAttr *attr = child->properties; attr != NULL; attr = attr->next) { if (strcmp(reinterpret_cast(attr->ns->href), "http://template.sesse.net/") == 0 && strcmp(reinterpret_cast(attr->name), "id") == 0) { - id = reinterpret_cast(xmlNodeGetContent(attr->children)); + xmlChar *id_buf = xmlNodeGetContent(attr->children); + id = reinterpret_cast(id_buf); + xmlFree(id_buf); id_attr = attr; } } -- 2.39.2