qemu: check for json allocation failure

Detected by Coverity.  Introduced in commit b1b5b51.

* src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetBlockInfo):
Avoid null dereference.
This commit is contained in:
Eric Blake 2011-10-12 18:10:24 -06:00
parent 430156cf32
commit ce521f242a

View File

@ -1364,6 +1364,9 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon,
virJSONValuePtr reply = NULL;
virJSONValuePtr devices;
if (!cmd)
return -1;
ret = qemuMonitorJSONCommand(mon, cmd, &reply);
if (ret == 0)
ret = qemuMonitorJSONCheckError(cmd, reply);