From 6c36a662e5ee26b90c1e1f6d0eec08ee78d67b7e Mon Sep 17 00:00:00 2001 From: spx Date: Sat, 19 Feb 2011 11:12:06 +0000 Subject: [PATCH] CoreTemp: Fixed mutex handle leak. --- Plugins/PluginCoreTemp/SharedMem.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Plugins/PluginCoreTemp/SharedMem.cpp b/Plugins/PluginCoreTemp/SharedMem.cpp index 300d5a57..47ca0741 100644 --- a/Plugins/PluginCoreTemp/SharedMem.cpp +++ b/Plugins/PluginCoreTemp/SharedMem.cpp @@ -32,15 +32,17 @@ bool CSharedMemClient::ReadSharedMem(PCORE_TEMP_SHARED_DATA i_SharedData) if (hdlMemory == NULL) { ReleaseMutex(hdlMutex); + CloseHandle(hdlMutex); return false; } pSharedData = (PCORE_TEMP_SHARED_DATA)MapViewOfFile(hdlMemory, FILE_MAP_READ, 0, 0, 0); if (pSharedData == NULL) { - ReleaseMutex(hdlMutex); CloseHandle(hdlMemory); hdlMemory = NULL; + ReleaseMutex(hdlMutex); + CloseHandle(hdlMutex); return false; } @@ -58,6 +60,7 @@ bool CSharedMemClient::ReadSharedMem(PCORE_TEMP_SHARED_DATA i_SharedData) UnmapViewOfFile(pSharedData); CloseHandle(hdlMemory); ReleaseMutex(hdlMutex); + CloseHandle(hdlMutex); return bRet; } \ No newline at end of file