checkpolicy: check return code on ebitmap_set_bit

This can fail due to ENOMEM.  Check and return code and return error if
necessary.

Signed-off-by: Eric Paris <eparis@redhat.com>
This commit is contained in:
Eric Paris 2012-07-03 14:45:38 -04:00
parent 87e8d46f29
commit 873c176651

View File

@ -2341,7 +2341,10 @@ int define_role_trans(int class_specified)
return -1;
}
ebitmap_set_bit(&e_classes, cladatum->s.value - 1, TRUE);
if (ebitmap_set_bit(&e_classes, cladatum->s.value - 1, TRUE)) {
yyerror("out of memory");
return -1;
}
}
id = (char *)queue_remove(id_queue);