qemuDomainDetachChrDevice: Don't leak @charAlias

Moreover, since virAsprintf now does report OOM error, there's no need
to call virReportOOMError in error path.
This commit is contained in:
Michal Privoznik 2013-07-18 12:35:51 +02:00
parent 23e938ee63
commit b7658f6234

View 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) {