Skip to content

Commit

Permalink
Fix a possible leak of a file descriptor
Browse files Browse the repository at this point in the history
The same issue as ruby/prism#3246
  • Loading branch information
mame committed Nov 28, 2024
1 parent 43b059b commit 2c20069
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions prism_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2c20069

Please sign in to comment.