In function define_type(), some error conditions between "id = queue_remove(id_queue)" and "get_local_type(id, attr->s.value, 1)" returned without freeing id. Fix theses memory leaks. Signed-off-by: Nicolas Iooss <nicolas.iooss@xxxxxxx> --- checkpolicy/policy_define.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/checkpolicy/policy_define.c b/checkpolicy/policy_define.c index 6bfadbe59c91..03a0c18a9686 100644 --- a/checkpolicy/policy_define.c +++ b/checkpolicy/policy_define.c @@ -1426,11 +1426,13 @@ int define_type(int alias) if (!attr) { /* treat it as a fatal error */ yyerror2("attribute %s is not declared", id); + free(id); return -1; } if (attr->flavor != TYPE_ATTRIB) { yyerror2("%s is a type, not an attribute", id); + free(id); return -1; } -- 2.11.0 _______________________________________________ Selinux mailing list Selinux@xxxxxxxxxxxxx To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx. To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.