From 2db6d12a6cf097b5762d803693eb3182add19d48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Thu, 28 Nov 2024 16:32:39 +0100 Subject: [PATCH] libselinux/utils: use correct error handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: James Carter --- libselinux/utils/sefcontext_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libselinux/utils/sefcontext_compile.c b/libselinux/utils/sefcontext_compile.c index 23d312744..5d7ab301b 100644 --- a/libselinux/utils/sefcontext_compile.c +++ b/libselinux/utils/sefcontext_compile.c @@ -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)