libselinux/utils: use correct error handling
PATCH 1/1 libselinux/utils: use correct error handling
From: Christian Göttsche <[email protected]>
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 <[email protected]>
--- libselinux/utils/sefcontext_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
libselinux/utils/sefcontext_compile.c +1 -1
@@ -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)
Signature · 1 line
2.45.2
Quoted 9 lines · Christian Göttsche
From: Christian Göttsche <[email protected]>
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 <[email protected]>
Acked-by James Carter <[email protected]>
Quoted 21 lines
--- libselinux/utils/sefcontext_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)libselinux/utils/sefcontext_compile.c +1
-2@@ -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) --2.45.2
Quoted 6 lines · James Carter
Quoted 3 lines · Christian Göttsche
From: Christian Göttsche <[email protected]>
Quoted 9 lines
Quoted 6 lines
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 <[email protected]>Acked-by James Carter <[email protected]>
Merged.
Thanks,
Jim
Quoted 21 lines
Quoted 21 lines
--- libselinux/utils/sefcontext_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)libselinux/utils/sefcontext_compile.c +1
-2@@ -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) --2.45.2