summaryrefslogtreecommitdiff
path: root/prism_compile.c
diff options
context:
space:
mode:
authorYusuke Endoh <[email protected]>2024-11-28 12:57:28 +0900
committerYusuke Endoh <[email protected]>2024-11-28 13:26:26 +0900
commitc0e607cef1fb6e1795b0969c1533b63dc349d484 ()
tree76199ae76a4e92fde8682f33ec9452d3f66fb7c0 /prism_compile.c
parentd94ae8b8f980ae838f5d641584fe99a269f68857 (diff)
Fix a possible of a file descriptor
The same issue as https://.com/ruby/prism/pull/3246 Coverity Scan found this issue.
Notes: Merged: https://.com/ruby/ruby/pull/12192
-rw-r--r--prism_compile.c1
1 files changed, 1 insertions, 0 deletions
@@ -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) {
return PM_STRING_INIT_ERROR_GENERIC;
}