render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Mark McLoughlin f1ac00
From 9b926eb4c485bd81b0b553107dbb037c2188cd23 Mon Sep 17 00:00:00 2001
Mark McLoughlin f1ac00
From: Mark McLoughlin <markmc@redhat.com>
Mark McLoughlin f1ac00
Date: Thu, 17 Sep 2009 15:31:08 +0100
Mark McLoughlin f1ac00
Subject: [PATCH] Fix net/disk hot-unplug segfault
Mark McLoughlin f1ac00
Mark McLoughlin f1ac00
When we hot-unplug the last device, we're currently double-freeing
Mark McLoughlin f1ac00
the device definition.
Mark McLoughlin f1ac00
Mark McLoughlin f1ac00
Reported by Michal Nowak here:
Mark McLoughlin f1ac00
Mark McLoughlin f1ac00
  https://bugzilla.redhat.com/523960
Mark McLoughlin f1ac00
Mark McLoughlin f1ac00
* src/qemu_driver.c: fix double free
Mark McLoughlin f1ac00
Mark McLoughlin f1ac00
Fedora-patch: libvirt-fix-net-hotunplug-double-free.patch
Mark McLoughlin f1ac00
---
Mark McLoughlin f1ac00
 src/qemu_driver.c |    4 ++--
Mark McLoughlin f1ac00
 1 files changed, 2 insertions(+), 2 deletions(-)
Mark McLoughlin f1ac00
Mark McLoughlin f1ac00
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
Mark McLoughlin f1ac00
index a65334f..de31581 100644
Mark McLoughlin f1ac00
--- a/src/qemu_driver.c
Mark McLoughlin f1ac00
+++ b/src/qemu_driver.c
Mark McLoughlin f1ac00
@@ -5998,7 +5998,7 @@ try_command:
Mark McLoughlin f1ac00
             /* ignore, harmless */
Mark McLoughlin f1ac00
         }
Mark McLoughlin f1ac00
     } else {
Mark McLoughlin f1ac00
-        VIR_FREE(vm->def->disks[0]);
Mark McLoughlin f1ac00
+        VIR_FREE(vm->def->disks);
Mark McLoughlin f1ac00
         vm->def->ndisks = 0;
Mark McLoughlin f1ac00
     }
Mark McLoughlin f1ac00
     virDomainDiskDefFree(detach);
Mark McLoughlin f1ac00
@@ -6100,7 +6100,7 @@ qemudDomainDetachNetDevice(virConnectPtr conn,
Mark McLoughlin f1ac00
             /* ignore, harmless */
Mark McLoughlin f1ac00
         }
Mark McLoughlin f1ac00
     } else {
Mark McLoughlin f1ac00
-        VIR_FREE(vm->def->nets[0]);
Mark McLoughlin f1ac00
+        VIR_FREE(vm->def->nets);
Mark McLoughlin f1ac00
         vm->def->nnets = 0;
Mark McLoughlin f1ac00
     }
Mark McLoughlin f1ac00
     virDomainNetDefFree(detach);
Mark McLoughlin f1ac00
-- 
Mark McLoughlin f1ac00
1.6.2.5
Mark McLoughlin f1ac00