提交 fa911ec4 编写于 作者: D Daniel P. Berrange

Fix leak of char device in xenParseXM

If an OOM occurs in xenParseXM, a virDomainChrDef may be
leaked.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 145de7b8
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册