projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tests: validate_xml: leak of xml document instance
[lttng-tools.git]
/
tests
/
utils
/
xml-utils
/
validate_xml.cpp
diff --git
a/tests/utils/xml-utils/validate_xml.cpp
b/tests/utils/xml-utils/validate_xml.cpp
index 8e30100c0bcf5cd2f11e249d7f3a259d856a61f1..f75c8e47b063a1a46de2e38a30087467a0ebf25f 100644
(file)
--- a/
tests/utils/xml-utils/validate_xml.cpp
+++ b/
tests/utils/xml-utils/validate_xml.cpp
@@
-25,9
+25,7
@@
#include <libxml/parser.h>
#include <lttng/lttng-error.h>
#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;
struct validation_ctx {
xmlSchemaParserCtxtPtr parser_ctx;
@@
-147,14
+145,16
@@
static int validate_xml(const char *xml_file_path, struct validation_ctx *ctx)
ret = CMD_SUCCESS;
end:
ret = CMD_SUCCESS;
end:
+ if (doc) {
+ xmlFreeDoc(doc);
+ }
return ret;
return ret;
-
-
}
}
+
int main(int argc, char **argv)
{
int ret;
int main(int argc, char **argv)
{
int ret;
- struct validation_ctx ctx = {
0
};
+ struct validation_ctx ctx = {};
/* Check if we have all argument */
if (argc < 3) {
/* Check if we have all argument */
if (argc < 3) {
This page took
0.02336 seconds
and
4
git commands to generate.