Skip to content

Commit

Permalink
libselinux/utils: use correct error handling
Browse files Browse the repository at this point in the history
Instead of returning directly goto the err label, which prints a message
and closes the opened file stream.

Found by clang-analyzer.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: James Carter <jwcart2@gmail.com>
  • Loading branch information
cgzones authored and jwcart2 committed Dec 4, 2024
1 parent 3ff5f9e commit 2db6d12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libselinux/utils/sefcontext_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ static int write_binary_file(const struct saved_data *data, const struct sidtab
/* write context table */
rc = write_sidtab(bin_file, stab);
if (rc)
return rc;
goto err;

rc = write_spec_node(bin_file, do_write_precompregex, data->root, stab);
if (rc)
Expand Down

0 comments on commit 2db6d12

Please sign in to comment.