checkpolicy: free role identifier in define_role_dom()
PATCH 1/1 checkpolicy: free role identifier in define_role_dom()
Free the role identifier in case the role has been already defined beforehand, since in that case the identifier is not stored via declare_symbol().
Signed-off-by Christian Göttsche <[email protected]>
---
Triggered by the checkpolicy round-trip patch in the GitHub CI.
--- checkpolicy/policy_define.c | 4 ++++ 1 file changed, 4 insertions(+)
checkpolicy/policy_define.c +4 -0
@@ -3045,7 +3045,11 @@ role_datum_t *define_role_dom(role_datum_t * r)yyerror ("Out of memory!" ); goto cleanup; } + }else { +free (role_id); + role_id =NULL ; } +if (r) {ebitmap_t types;ebitmap_init (&types);
Signature · 1 line
2.40.1
Quoted 6 lines · Christian Göttsche
Free the role identifier in case the role has been already defined beforehand, since in that case the identifier is not stored via
declare_symbol().Signed-off-by Christian Göttsche <[email protected]>
The right answer here is to just remove role dominance from checkpolicy. I've sent a patch to the list. Thanks,
Jim
Quoted 25 lines
---
Triggered by the checkpolicy round-trip patch in the GitHub CI.--- checkpolicy/policy_define.c | 4 ++++ 1 file changed, 4 insertions(+)checkpolicy/policy_define.c +4
-1@@ -3045,7 +3045,11 @@ role_datum_t *define_role_dom(role_datum_t * r)yyerror ("Out of memory!" ); goto cleanup; } + }else { +free (role_id); + role_id =NULL ; } +if (r) {ebitmap_t types;ebitmap_init (&types); --2.40.1