mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Fix a possible leak of a file descriptor
The same issue as https://github.com/ruby/prism/pull/3246 Coverity Scan found this issue.
This commit is contained in:
parent
d94ae8b8f9
commit
c0e607cef1
Notes:
git
2024-11-28 04:26:48 +00:00
1 changed files with 1 additions and 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) {
|
||||
close(fd);
|
||||
return PM_STRING_INIT_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue