[libvirt] [PATCH 4/6] libxkutil/xml_parse_test: Coverity cleanup

John Ferlan jferlan at redhat.com
Wed Jan 22 19:05:11 UTC 2014


A new version of Coverity found:

print_domxml(): RESOURCE_LEAK
  - The 'xml' variable needs to be free()'d

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 libxkutil/xml_parse_test.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libxkutil/xml_parse_test.c b/libxkutil/xml_parse_test.c
index 374bcf6..303880d 100644
--- a/libxkutil/xml_parse_test.c
+++ b/libxkutil/xml_parse_test.c
@@ -192,6 +192,7 @@ static void print_domxml(struct domain *dominfo,
                 printf("Failed to create system XML\n");
         else
                 printf("%s\n", xml);
+        free(xml);
 }
 
 static char *read_from_file(FILE *file)
-- 
1.8.4.2




More information about the libvir-list mailing list