Skip to content

Commit 60a98a5

Browse files
committed
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
1 parent 83d3d1b commit 60a98a5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

DockingFeature/DockingDlgInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class DockingDlgInterface : public StaticDialog
4141

4242
void create(tTbData * data, bool isRTL = false){
4343
StaticDialog::create(_dlgID, isRTL);
44-
::GetWindowText(_hSelf, _pluginName, sizeof(_pluginName));
44+
::GetWindowText(_hSelf, _pluginName, sizeof(_pluginName)/sizeof(TCHAR));
4545

4646
// user information
4747
data->hClient = _hSelf;

globals.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ wstring GetPythonPath() {
9797
pythonInstalled = true;
9898
break;
9999
}
100+
101+
delete[] nPtr;
100102
} while (FindNextFile(h, &data));
101103
}
102104

0 commit comments

Comments
 (0)