projects
/
platform
/
upstream
/
dotnet
/
runtime.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ccdc7e1
)
Closing opened handles to avoid resource leak. (#51950)
author
Artem Kliatchkine
<artem.kliatchkine@gmail.com>
Tue, 25 May 2021 16:11:50 +0000
(18:11 +0200)
committer
GitHub
<noreply@github.com>
Tue, 25 May 2021 16:11:50 +0000
(09:11 -0700)
SymReader::InitializeFromFile opens file handles which were not closed causing resource leaks on each call.
Fix #50422
Co-authored-by: Artem Kliatchkine <eldog@rambler.ru>
src/coreclr/debug/ildbsymlib/symread.cpp
patch
|
blob
|
history
diff --git
a/src/coreclr/debug/ildbsymlib/symread.cpp
b/src/coreclr/debug/ildbsymlib/symread.cpp
index
dc12d4f
..
168d84f
100644
(file)
--- a/
src/coreclr/debug/ildbsymlib/symread.cpp
+++ b/
src/coreclr/debug/ildbsymlib/symread.cpp
@@
-722,6
+722,12
@@
SymReader::InitializeFromFile(
}
ErrExit:
+ if (hMod)
+ UnmapViewOfFile(hMod);
+ if (hMapFile != INVALID_HANDLE_VALUE)
+ CloseHandle(hMapFile);
+ if (hFile != INVALID_HANDLE_VALUE)
+ CloseHandle(hFile);
return hr;
}