mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
qemu: fix use-after-free regression
Commit baade4d fixed a memory leak on failure, but in the process, introduced a use-after-free on success, which can be triggered with: 1. set bandwidth with --live 2. query bandwidth 3. set bandwidth with --live * src/qemu/qemu_driver.c (qemuDomainSetInterfaceParameters): Don't free newBandwidth on success. Reported by Hu Tao.
This commit is contained in:
parent
302fe95ffa
commit
820a2159e9
@ -8034,6 +8034,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
|
||||
|
||||
virNetDevBandwidthFree(net->bandwidth);
|
||||
net->bandwidth = newBandwidth;
|
||||
newBandwidth = NULL;
|
||||
}
|
||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||
if (!persistentNet->bandwidth) {
|
||||
|
Loading…
Reference in New Issue
Block a user