Skip to content

Commit

Permalink
checkpolicy: cleanup lexer
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
  • Loading branch information
cgzones committed Nov 8, 2023
1 parent 708a30a commit e31a5c6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion checkpolicy/parse_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ extern FILE *yyin;
extern void init_parser(int);
extern int yyparse(void);
extern void yyrestart(FILE *);
extern int yylex_destroy(void);
extern queue_t id_queue;
extern unsigned int policydb_errors;
extern policydb_t *policydbp;
Expand Down Expand Up @@ -59,6 +60,7 @@ int read_source_policy(policydb_t * p, const char *file, const char *progname)
progname);
queue_destroy(id_queue);
fclose(yyin);
yylex_destroy();
return -1;
}
rewind(yyin);
Expand All @@ -71,11 +73,13 @@ int read_source_policy(policydb_t * p, const char *file, const char *progname)
progname);
queue_destroy(id_queue);
fclose(yyin);
yylex_destroy();
return -1;
}
queue_destroy(id_queue);

queue_destroy(id_queue);
fclose(yyin);
yylex_destroy();

return 0;
}

0 comments on commit e31a5c6

Please sign in to comment.