Skip to content

Commit

Permalink
mmap: Fix file descriptor leak caused by ownership handover from fd_t…
Browse files Browse the repository at this point in the history
… not implying its closure here
  • Loading branch information
amyspark committed Jan 18, 2024
1 parent 2484838 commit 11a178b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions substrate/mmap
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ namespace substrate
#ifdef _WIN32
if (_mapping)
CloseHandle(_mapping);
if (_fd != -1)
_close(_fd);
#else
if (_fd != -1)
::close(_fd);
Expand Down

0 comments on commit 11a178b

Please sign in to comment.