mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
qemu: Fix possible NULL deref in qemuDomainGetResctrlMonData
If virQEMUDriverGetCapabilities returns NULL, then a subsequent deref of @caps would cause an error, so we just return failure. Found by Coverity Signed-off-by: John Ferlan <jferlan@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
a067b781e9
commit
4e02d52ab9
@ -20728,7 +20728,8 @@ qemuDomainGetResctrlMonData(virQEMUDriverPtr driver,
|
||||
size_t i = 0;
|
||||
size_t j = 0;
|
||||
|
||||
caps = virQEMUDriverGetCapabilities(driver, false);
|
||||
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
|
||||
return -1;
|
||||
|
||||
switch (tag) {
|
||||
case VIR_RESCTRL_MONITOR_TYPE_CACHE:
|
||||
|
Loading…
Reference in New Issue
Block a user