summaryrefslogtreecommitdiffstats
path: root/src/os_unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index b7da55205d..474d288019 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -7740,7 +7740,10 @@ mch_get_random(char_u *buf, int len)
if (fd == -1)
dev_urandom_state = FAIL;
else if (read(fd, buf, len) == len)
+ {
dev_urandom_state = OK;
+ close(fd);
+ }
else
{
dev_urandom_state = FAIL;