]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libxl: eliminate memory leak in libxmlDomainModifyDeviceFlags
authorLaine Stump <laine@laine.org>
Mon, 27 Feb 2012 10:52:29 +0000 (05:52 -0500)
committerLaine Stump <laine@laine.org>
Tue, 28 Feb 2012 12:43:38 +0000 (07:43 -0500)
This call to virDomainDeviceDefParse is both unnecessary (since
it will again be called at the top of the immediately following if(),
and if not there, then at the top of the if following that), but it
also creates a leak of one virDomainDeviceDef and one [whatever type
of device the DeviceDef is pointing to; probably a virDomainDiskDef]
in the case that the function has been called with
VIR_DOMAIN_DEVICE_MODIFY_CONFIG (the second parse will overwrite the
devicedef that was just created).

src/libxl/libxl_driver.c

index 6db33c25e0bb6ab54b7b5f22cbf0910ee1ceb493..d5fa64a87da2c0ae1e0c22375403cd3c731e9896 100644 (file)
@@ -3243,10 +3243,6 @@ libxlDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
          goto cleanup;
     }
 
-    if (!(dev = virDomainDeviceDefParse(driver->caps, vm->def, xml,
-                                  VIR_DOMAIN_XML_INACTIVE)))
-        goto cleanup;
-
     priv = vm->privateData;
 
     if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {