提交 f0c513a6 编写于 作者: J Jim Fehlig

libxl: unref DomainObjPrivate on error path

There is a potential leak of a newly created libxlDomainObjPrivate
when subsequent allocation of the object's chrdev field fails.
Unref the object on such an error so that it is properly disposed.
上级 5075248a
......@@ -454,8 +454,10 @@ libxlDomainObjPrivateAlloc(void)
if (!(priv = virObjectLockableNew(libxlDomainObjPrivateClass)))
return NULL;
if (!(priv->devs = virChrdevAlloc()))
if (!(priv->devs = virChrdevAlloc())) {
virObjectUnref(priv);
return NULL;
}
return priv;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册