提交 f60ec522 编写于 作者: J John Ferlan

tests: Fix leak in securityselinuxtest

If we jump to the error: label and @secbuf is allocated, then it's not
free'd at all.

Found by Coverity
上级 f3cdbf22
...@@ -68,7 +68,7 @@ testBuildDomainDef(bool dynamic, ...@@ -68,7 +68,7 @@ testBuildDomainDef(bool dynamic,
const char *baselabel) const char *baselabel)
{ {
virDomainDefPtr def; virDomainDefPtr def;
virSecurityLabelDefPtr secdef; virSecurityLabelDefPtr secdef = NULL;
if (!(def = virDomainDefNew())) if (!(def = virDomainDefNew()))
goto error; goto error;
...@@ -98,6 +98,7 @@ testBuildDomainDef(bool dynamic, ...@@ -98,6 +98,7 @@ testBuildDomainDef(bool dynamic,
error: error:
virDomainDefFree(def); virDomainDefFree(def);
virSecurityLabelDefFree(secdef);
return NULL; return NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册