Skip to content

Commit bb89b13

Browse files
committed
close fd in destructor
1 parent 5e66b93 commit bb89b13

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/datadog/platform_util.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ std::tuple<std::string, std::string> get_windows_info() {
102102
// application manifest, which is the lowest version supported by the
103103
// application. Use `RtlGetVersion` to obtain the accurate OS version
104104
// regardless of the manifest.
105-
using RtlGetVersion = auto(*)(LPOSVERSIONINFOEXW)->NTSTATUS;
105+
using RtlGetVersion = auto (*)(LPOSVERSIONINFOEXW)->NTSTATUS;
106106

107107
RtlGetVersion func =
108108
(RtlGetVersion)GetProcAddress(GetModuleHandleA("ntdll"), "RtlGetVersion");
@@ -246,6 +246,7 @@ InMemoryFile::~InMemoryFile() {
246246
/// by `MFD_CLOEXEC`.
247247
if (handle_ == nullptr) return;
248248
int* data = static_cast<int*>(handle_);
249+
close(*data);
249250
delete (data);
250251
}
251252

0 commit comments

Comments
 (0)