From 11a178b6f0d80f2673b1f1406e635c1630997d98 Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Thu, 18 Jan 2024 11:41:28 -0300 Subject: [PATCH] mmap: Fix file descriptor leak caused by ownership handover from fd_t not implying its closure here --- substrate/mmap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/substrate/mmap b/substrate/mmap index 00a8bc08..299ae9e1 100644 --- a/substrate/mmap +++ b/substrate/mmap @@ -225,6 +225,8 @@ namespace substrate #ifdef _WIN32 if (_mapping) CloseHandle(_mapping); + if (_fd != -1) + _close(_fd); #else if (_fd != -1) ::close(_fd);