From: John Ferlan Date: Tue, 23 Jul 2019 12:09:19 +0000 (-0400) Subject: test: Return early in testQueryJobs X-Git-Tag: v5.6.0-rc1~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73717ca074ee7d1982f809cbfb5ef43cb3d8e647;p=thirdparty%2Flibvirt.git test: Return early in testQueryJobs Avoid the chance that qemuMonitorTestNewSimple could return NULL Found by Coverity Signed-off-by: John Ferlan ACKed-by: Peter Krempa --- 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 ||