summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Windows
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-10-21 00:34:39 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-10-21 00:34:39 +0000
commitdf9515324d7a759d9affa6f22e9cf80fe9cb10e6 (patch)
tree47928e14f09251d0a8b6d4a30694a387412f3feb /llvm/lib/Support/Windows
parent74dd8547db8d57522675caed4153a0d47e942575 (diff)
downloadbcm5719-llvm-df9515324d7a759d9affa6f22e9cf80fe9cb10e6.tar.gz
bcm5719-llvm-df9515324d7a759d9affa6f22e9cf80fe9cb10e6.zip
PR21202: Memory leak in Windows RWMutexImpl when using SRWLOCK
llvm-svn: 220251
Diffstat (limited to 'llvm/lib/Support/Windows')
-rw-r--r--llvm/lib/Support/Windows/RWMutex.inc8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Support/Windows/RWMutex.inc b/llvm/lib/Support/Windows/RWMutex.inc
index 00d0e93d8d5..2d1d25f67b8 100644
--- a/llvm/lib/Support/Windows/RWMutex.inc
+++ b/llvm/lib/Support/Windows/RWMutex.inc
@@ -84,12 +84,10 @@ RWMutexImpl::RWMutexImpl() {
}
RWMutexImpl::~RWMutexImpl() {
- if (sHasSRW) {
- // Nothing to do in the case of slim reader/writers
- } else {
+ if (!sHasSRW)
DeleteCriticalSection(static_cast<LPCRITICAL_SECTION>(data_));
- free(data_);
- }
+ // Nothing to do in the case of slim reader/writers except free the memory.
+ free(data_);
}
bool RWMutexImpl::reader_acquire() {
OpenPOWER on IntegriCloud