Tests: validate_xml: leak of xml document instance
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 31 Mar 2022 02:59:44 +0000 (22:59 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 31 Mar 2022 02:59:44 +0000 (22:59 -0400)
`doc` is never free'd when validating an XML.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ia0b541963350aeb6610382fd3226ffd37ab4847e

tests/utils/xml-utils/validate_xml.cpp

index b185161b5178b84ce9e80bb4c2a4cfd0027174bc..f75c8e47b063a1a46de2e38a30087467a0ebf25f 100644 (file)
@@ -145,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.027161 seconds and 5 git commands to generate.