summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--prism_compile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/prism_compile.c b/prism_compile.c
index 84f206ab8f..32d0c13223 100644
--- a/prism_compile.c
+++ b/prism_compile.c
@@ -10900,6 +10900,7 @@ pm_read_file(pm_string_t *string, const char *filepath)
source = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
if (source == MAP_FAILED) {
+ close(fd);
return PM_STRING_INIT_ERROR_GENERIC;
}