[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] add variable initializer
The following patch fixes a bug found by Coverity:
It is possible to goto cleanup: before outfile is
initialized. At cleanup: we try to close(outfile)
if it is not NULL.
Index: src/commit_api.c
===================================================================
--- src.orig/commit_api.c
+++ src/commit_api.c
@@ -182,7 +182,7 @@ int semod_expand_sandbox(char *sandbox,
char *kernel_filename = NULL;
sidtab_t sidtab;
struct policy_file pf;
- FILE *outfile;
+ FILE *outfile = NULL;
if (policydb_init (&out, POLICY_KERN) == -1) {
write_error (error_buf, error_buf_size, "Out of memory!");
retval = -1;
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@xxxxxxxxxxxxx with
the words "unsubscribe selinux" without quotes as the message.
This mailing list archive is a service of Copilot Consulting.