[PATCH] libselinux/utils: use correct error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Christian Göttsche <cgzones@xxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxx>
---
 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 23d31274..5d7ab301 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)
-- 
2.45.2





[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux