Tests: validate_xml: leak of xml document instance
[lttng-tools.git] / tests / utils / xml-utils / validate_xml.cpp
index 92f08f203221458b5c1dce0250ce9162fa34db58..f75c8e47b063a1a46de2e38a30087467a0ebf25f 100644 (file)
@@ -25,9 +25,7 @@
 #include <libxml/parser.h>
 
 #include <lttng/lttng-error.h>
-#include <common/macros.h>
-
-#include <common/macros.h>
+#include <common/macros.hpp>
 
 struct validation_ctx {
        xmlSchemaParserCtxtPtr parser_ctx;
@@ -147,10 +145,12 @@ static int validate_xml(const char *xml_file_path, struct validation_ctx *ctx)
 
        ret = CMD_SUCCESS;
 end:
+       if (doc) {
+               xmlFreeDoc(doc);
+       }
        return ret;
-
-
 }
+
 int main(int argc, char **argv)
 {
        int ret;
This page took 0.023737 seconds and 4 git commands to generate.