]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuDomainDetachChrDevice: Don't leak @charAlias
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 18 Jul 2013 10:35:51 +0000 (12:35 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 18 Jul 2013 12:16:53 +0000 (14:16 +0200)
Moreover, since virAsprintf now does report OOM error, there's no need
to call virReportOOMError in error path.

src/qemu/qemu_hotplug.c

index 788ad473efb1f984f5cb1934352736dcb8b93537..a98de9d253d5a7fbc4f30fe4590821199042522a 100644 (file)
@@ -3155,10 +3155,8 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
     if (qemuBuildChrDeviceStr(&devstr, vm->def, chr, priv->qemuCaps) < 0)
         return ret;
 
-    if (virAsprintf(&charAlias, "char%s", tmpChr->info.alias) < 0) {
-        virReportOOMError();
-        return ret;
-    }
+    if (virAsprintf(&charAlias, "char%s", tmpChr->info.alias) < 0)
+        goto cleanup;
 
     qemuDomainObjEnterMonitor(driver, vm);
     if (devstr && qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) < 0) {