提交 ce521f24 编写于 作者: E Eric Blake

qemu: check for json allocation failure

Detected by Coverity.  Introduced in commit b1b5b51a.

* src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetBlockInfo):
Avoid null dereference.
上级 430156cf
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册