提交 2cc03c80 编写于 作者: J John Ferlan

libxl_domain: Resolve Coverity RESOURCE_LEAK

On the error path need to free the chrdef
上级 6f8a4f6d
...@@ -532,8 +532,10 @@ libxlDomainDefPostParse(virDomainDefPtr def, ...@@ -532,8 +532,10 @@ libxlDomainDefPostParse(virDomainDefPtr def,
chrdef->target.port = 0; chrdef->target.port = 0;
chrdef->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN; 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; return -1;
}
def->nconsoles = 1; def->nconsoles = 1;
def->consoles[0] = chrdef; def->consoles[0] = chrdef;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册