[PATCH 2/4] test: Return early in testQueryJobs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avoid the chance that qemuMonitorTestNewSimple could return NULL

Found by Coverity

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 tests/qemumonitorjsontest.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 8eb9d2e01b..bf89f49aca 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -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 ||
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux