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:
Eric Paris 2013-02-05 14:03:07 -05:00
parent 5812ec2fbb
commit 06f2a7c3a9

View File

@ -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;