From 60a98a522df5a0bcc45c022db1e4330d2c16e03e Mon Sep 17 00:00:00 2001 From: ip_gpu Date: Mon, 30 Oct 2017 13:38:46 +0500 Subject: [PATCH] fixed from PVS-Studio: V575 The number of processed elements should be passed to the 'GetWindowTextW' function as the third argument instead of buffer's size in bytes. dockingdlginterface.h 44 V773 Visibility scope of the 'nPtr' pointer was exited without releasing the memory. A memory leak is possible. globals.cpp 100 --- DockingFeature/DockingDlgInterface.h | 2 +- globals.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DockingFeature/DockingDlgInterface.h b/DockingFeature/DockingDlgInterface.h index 894aa8e..dbaffa0 100644 --- a/DockingFeature/DockingDlgInterface.h +++ b/DockingFeature/DockingDlgInterface.h @@ -41,7 +41,7 @@ class DockingDlgInterface : public StaticDialog void create(tTbData * data, bool isRTL = false){ StaticDialog::create(_dlgID, isRTL); - ::GetWindowText(_hSelf, _pluginName, sizeof(_pluginName)); + ::GetWindowText(_hSelf, _pluginName, sizeof(_pluginName)/sizeof(TCHAR)); // user information data->hClient = _hSelf; diff --git a/globals.cpp b/globals.cpp index f185abf..8990234 100644 --- a/globals.cpp +++ b/globals.cpp @@ -97,6 +97,8 @@ wstring GetPythonPath() { pythonInstalled = true; break; } + + delete[] nPtr; } while (FindNextFile(h, &data)); }