Skip to content

Commit

Permalink
checkpolicy: free complete role_allow_rule on error
Browse files Browse the repository at this point in the history
Free the ebitmaps inside the rolesets on error.

Reported-by: oss-fuzz (issue 67769)
Signed-off-by: Christian Göttsche <[email protected]>
Acked-by: James Carter <[email protected]>
  • Loading branch information
cgzones authored and jwcart2 committed Apr 4, 2024
1 parent 04303b5 commit 652e288
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions checkpolicy/policy_define.c
Expand Up @@ -3186,13 +3186,15 @@ int define_role_allow(void)

while ((id = queue_remove(id_queue))) {
if (set_roles(&ra->roles, id)) {
role_allow_rule_destroy(ra);
free(ra);
return -1;
}
}

while ((id = queue_remove(id_queue))) {
if (set_roles(&ra->new_roles, id)) {
role_allow_rule_destroy(ra);
free(ra);
return -1;
}
Expand Down

0 comments on commit 652e288

Please sign in to comment.