mirror of
https://github.com/SELinuxProject/selinux
synced 2025-02-17 01:56:53 +00:00
libsepol/tests: fix use of unitialized variable
When write_binary_policy() fails to open the binary policy, it calls sepol_handle_destroy(f.handle) but structure f has not been initialized at this point. Use variable handle instead. This issue has been found using clang's static analyzer. Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
This commit is contained in:
parent
49a4963911
commit
e303de242c
@ -254,7 +254,7 @@ int write_binary_policy(const char *path, policydb_t *p)
|
||||
if ((out_fp = fopen(path, "w" )) == NULL) {
|
||||
fprintf(stderr, "Unable to open %s: %s\n", path,
|
||||
strerror(errno));
|
||||
sepol_handle_destroy(f.handle);
|
||||
sepol_handle_destroy(handle);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user