mirror of
https://github.com/SELinuxProject/selinux
synced 2024-12-25 07:22:07 +00:00
libsemanage: semanage_store: do not leak fd
We use creat to create the lock file needed later. But we never close that fd, so it just sits around until the program exits. After we create the file we don't need to hold onto the fd. close it. Signed-off-by: Eric Paris <eparis@redhat.com>
This commit is contained in:
parent
5812ec2fbb
commit
06f2a7c3a9
@ -351,6 +351,7 @@ int semanage_create_store(semanage_handle_t * sh, int create)
|
||||
path);
|
||||
return -2;
|
||||
}
|
||||
close(fd);
|
||||
} else {
|
||||
ERR(sh, "Could not read lock file at %s.", path);
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user