]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuDomainDetachDeviceConfig: Don't free device from @dev
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 15 Jun 2018 14:16:08 +0000 (16:16 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 18 Jun 2018 07:20:38 +0000 (09:20 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=1591561

For reasons I don't understand my original patch of 75f0fd51124
freed not only the chardev from domain but also the one from
passed virDomainDeviceDefPtr. This caused no troubles until now,
because those two pointers were separate, but after I've
introduced virDomainDetachDeviceAlias() they became the same
resulting in double free on detach.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_driver.c

index 42069ee6174a3c79c4f49b76f2a9154e1ab532a8..7fe86d4d2edd64f8de686e30b514497a42605864 100644 (file)
@@ -8241,8 +8241,6 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
             return -1;
 
         virDomainChrDefFree(chr);
-        virDomainChrDefFree(dev->data.chr);
-        dev->data.chr = NULL;
         break;
 
     case VIR_DOMAIN_DEVICE_FS: