mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-25 12:52:19 +00:00
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:
parent
430156cf32
commit
ce521f242a
@ -1364,6 +1364,9 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon,
|
|||||||
virJSONValuePtr reply = NULL;
|
virJSONValuePtr reply = NULL;
|
||||||
virJSONValuePtr devices;
|
virJSONValuePtr devices;
|
||||||
|
|
||||||
|
if (!cmd)
|
||||||
|
return -1;
|
||||||
|
|
||||||
ret = qemuMonitorJSONCommand(mon, cmd, &reply);
|
ret = qemuMonitorJSONCommand(mon, cmd, &reply);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = qemuMonitorJSONCheckError(cmd, reply);
|
ret = qemuMonitorJSONCheckError(cmd, reply);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user