mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
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)
|
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,
|
|||||||
|
|
||||||
error:
|
error:
|
||||||
virDomainDefFree(def);
|
virDomainDefFree(def);
|
||||||
|
virSecurityLabelDefFree(secdef);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user