diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index b451e8ee37..0fb8d65ac8 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -960,6 +960,9 @@ testQemuMonitorJSONCPU(const void *data) bool running = false; virDomainPausedReason reason = 0; + if (!test) + return -1; + if (qemuMonitorTestAddItem(test, "stop", "{\"return\": {}}") < 0 || qemuMonitorTestAddItem(test, "query-status", "{\"return\": {" @@ -1016,6 +1019,9 @@ testQemuMonitorJSONSimpleFunc(const void *opaque) const char *reply = data->reply; int ret = -1; + if (!test) + return -1; + if (!reply) reply = "{\"return\":{}}";