mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 09:55:18 +00:00
Fix leak of char device in xenParseXM
If an OOM occurs in xenParseXM, a virDomainChrDef may be leaked. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
145de7b8f3
commit
fa911ec44e
@ -1080,8 +1080,10 @@ xenParseXM(virConfPtr conf, int xendConfigVersion,
|
||||
if (!(chr = xenParseSxprChar(port, NULL)))
|
||||
goto cleanup;
|
||||
|
||||
if (VIR_REALLOC_N(def->serials, def->nserials+1) < 0)
|
||||
if (VIR_REALLOC_N(def->serials, def->nserials+1) < 0) {
|
||||
virDomainChrDefFree(chr);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
chr->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL;
|
||||
chr->target.port = portnum;
|
||||
|
Loading…
x
Reference in New Issue
Block a user