1
0
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:
John Ferlan 2014-08-27 14:47:43 -04:00
parent 6f8a4f6d65
commit 2cc03c8050

View File

@ -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;