In case of an error, qemuMonitorTestNewSimple returns NULL.
Error out instead of dereferencing it.
Found by Coverity, reported by John Ferlan.
bool running = false;
virDomainPausedReason reason = 0;
+ if (!test)
+ return -1;
+
if (qemuMonitorTestAddItem(test, "stop", "{\"return\": {}}") < 0 ||
qemuMonitorTestAddItem(test, "query-status",
"{\"return\": {"
const char *reply = data->reply;
int ret = -1;
+ if (!test)
+ return -1;
+
if (!reply)
reply = "{\"return\":{}}";