mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-26 03:21:44 +03:00
libxl_domain: Resolve Coverity RESOURCE_LEAK
On the error path need to free the chrdef
This commit is contained in:
parent
6f8a4f6d65
commit
2cc03c8050
@ -532,8 +532,10 @@ libxlDomainDefPostParse(virDomainDefPtr def,
|
||||
chrdef->target.port = 0;
|
||||
chrdef->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN;
|
||||
|
||||
if (VIR_ALLOC_N(def->consoles, 1) < 0)
|
||||
if (VIR_ALLOC_N(def->consoles, 1) < 0) {
|
||||
virDomainChrDefFree(chrdef);
|
||||
return -1;
|
||||
}
|
||||
|
||||
def->nconsoles = 1;
|
||||
def->consoles[0] = chrdef;
|
||||
|
Loading…
Reference in New Issue
Block a user