mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
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:
parent
23e938ee63
commit
b7658f6234
@ -3155,10 +3155,8 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver,
|
|||||||
if (qemuBuildChrDeviceStr(&devstr, vm->def, chr, priv->qemuCaps) < 0)
|
if (qemuBuildChrDeviceStr(&devstr, vm->def, chr, priv->qemuCaps) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (virAsprintf(&charAlias, "char%s", tmpChr->info.alias) < 0) {
|
if (virAsprintf(&charAlias, "char%s", tmpChr->info.alias) < 0)
|
||||||
virReportOOMError();
|
goto cleanup;
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
qemuDomainObjEnterMonitor(driver, vm);
|
qemuDomainObjEnterMonitor(driver, vm);
|
||||||
if (devstr && qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) < 0) {
|
if (devstr && qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user