Skip to content

Commit

Permalink
checkpolicy: free identifiers on invalid typebounds
Browse files Browse the repository at this point in the history
Free the two identifiers on an invalid typebounds in the error branch,
similar to the success branch.

Reported-by: oss-fuzz (issue 67700)
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 39b3cc5 commit 9f2f9e2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion checkpolicy/policy_define.c
Expand Up @@ -1477,8 +1477,12 @@ int define_typebounds(void)
}

while ((id = queue_remove(id_queue))) {
if (define_typebounds_helper(bounds, id))
if (define_typebounds_helper(bounds, id)) {
free(bounds);
free(id);
return -1;
}

free(id);
}
free(bounds);
Expand Down

0 comments on commit 9f2f9e2

Please sign in to comment.