libselinux: free elements on read_spec_entries() failure

Some entries might have been already parsed and allocated.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
Christian Göttsche 2023-08-14 14:08:55 +02:00 committed by James Carter
parent dcb8e1bfbb
commit 168edd1ca2

View File

@ -446,6 +446,9 @@ static inline int process_line(struct selabel_handle *rec,
"%s: line %u error due to: %m\n", path,
lineno);
}
free(regex);
free(type);
free(context);
return -1;
}