]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
test: Check return status for libxlxml2domconfigtest
authorJohn Ferlan <jferlan@redhat.com>
Wed, 14 Feb 2018 12:12:35 +0000 (07:12 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 11 Jun 2018 22:33:13 +0000 (18:33 -0400)
Commit id d8e8b63d introduced the test, but neglected to check for
error from virTestLoadFile in testCompareXMLToDomConfig.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Katerina Koukiou <kkoukiou@redhat.com>
tests/libxlxml2domconfigtest.c

index 0d2a7385e574a48efe23acdfe8be9af3a806df84..54a92cc959c9d395bcc4b71dd27b079a2d062823 100644 (file)
@@ -104,7 +104,9 @@ testCompareXMLToDomConfig(const char *xmlfile,
         goto cleanup;
     }
 
-    virTestLoadFile(jsonfile, &tempjson);
+    if (virTestLoadFile(jsonfile, &tempjson) < 0)
+        goto cleanup;
+
     if (libxl_domain_config_from_json(cfg->ctx, &expectconfig, tempjson) != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        "Failed to create libxl_domain_config from JSON doc");