Plus, in the case of security_preserve_bools(), prevent double freeing
in the case of security_get_bools() failing.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
if ( arg->bool_id >= num )
{
+ xfree(values);
rv = -ENOENT;
goto out;
}
{
for ( i = 0; i < *len; i++ )
xfree((*names)[i]);
+ xfree(*names);
}
xfree(*values);
goto out;
rc = security_get_bools(&nbools, &bnames, &bvalues, NULL);
if ( rc )
- goto out;
+ return rc;
for ( i = 0; i < nbools; i++ )
{
booldatum = hashtab_search(p->p_bools.table, bnames[i]);