libselinux/utils: use correct error handling

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>
This commit is contained in:
Christian Göttsche 2024-11-28 16:32:39 +01:00 committed by James Carter
parent 3ff5f9efdb
commit 2db6d12a6c

View File

@ -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)