checkpolicy: free identifiers on invalid typebounds

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 <cgzones@googlemail.com>
Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
Christian Göttsche 2024-03-30 14:35:01 +01:00 committed by James Carter
parent 39b3cc5135
commit 9f2f9e2847
1 changed files with 5 additions and 1 deletions

View File

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