mirror of https://gitee.com/openkylin/libvirt.git
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
This commit is contained in:
parent
f3cdbf22e3
commit
f60ec522a3
|
@ -68,7 +68,7 @@ testBuildDomainDef(bool dynamic,
|
|||
const char *baselabel)
|
||||
{
|
||||
virDomainDefPtr def;
|
||||
virSecurityLabelDefPtr secdef;
|
||||
virSecurityLabelDefPtr secdef = NULL;
|
||||
|
||||
if (!(def = virDomainDefNew()))
|
||||
goto error;
|
||||
|
@ -98,6 +98,7 @@ testBuildDomainDef(bool dynamic,
|
|||
|
||||
error:
|
||||
virDomainDefFree(def);
|
||||
virSecurityLabelDefFree(secdef);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue