Fix: sessiond: ODR violation results in memory corruption
[lttng-tools.git] / tests / utils / xml-utils / validate_xml.cpp
index b185161b5178b84ce9e80bb4c2a4cfd0027174bc..887f7af524c146a2f1f6d8b5ecd2ee018cc981c3 100644 (file)
 #include <lttng/lttng-error.h>
 #include <common/macros.hpp>
 
+namespace {
 struct validation_ctx {
        xmlSchemaParserCtxtPtr parser_ctx;
        xmlSchemaPtr schema;
        xmlSchemaValidCtxtPtr schema_validation_ctx;
 };
+} /* namespace */
 
 enum command_err_code {
        CMD_SUCCESS = 0,
@@ -145,10 +147,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.03169 seconds and 4 git commands to generate.