]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
test: Return early in testQueryJobs
authorJohn Ferlan <jferlan@redhat.com>
Tue, 23 Jul 2019 12:09:19 +0000 (08:09 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 23 Jul 2019 14:56:16 +0000 (10:56 -0400)
Avoid the chance that qemuMonitorTestNewSimple could return NULL

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
tests/qemumonitorjsontest.c

index 8eb9d2e01bbfe1e374b299225de7a35e57b7bebe..bf89f49acab4da170cf8d40009322661855d4af6 100644 (file)
@@ -2959,6 +2959,9 @@ testQueryJobs(const void *opaque)
     size_t i;
     int ret = -1;
 
+    if (!test)
+        return -1;
+
     if (virAsprintf(&filenameJSON,
                     abs_srcdir "/qemumonitorjsondata/query-jobs-%s.json",
                     data->name) < 0 ||