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:
John Ferlan 2017-08-23 12:32:23 -04:00
parent f3cdbf22e3
commit f60ec522a3

View File

@ -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;
}