Close file descriptor after reading "/proc/sys/vm/overcommit_memory".

This bug was introduced by c2f970c32b
(Modify pages_map() to support mapping uncommitted virtual memory.).

This resolves #399.
This commit is contained in:
Jason Evans 2016-09-26 15:55:40 -07:00
parent ea68cd25b6
commit 3c8c3e9e9b

View File

@ -219,6 +219,7 @@ os_overcommits_proc(void)
return (false); /* Error. */ return (false); /* Error. */
nread = read(fd, &buf, sizeof(buf)); nread = read(fd, &buf, sizeof(buf));
close(fd);
if (nread < 1) if (nread < 1)
return (false); /* Error. */ return (false); /* Error. */
/* /*