aboutsummaryrefslogtreecommitdiffstats
path: root/win/vncconfig/Legacy.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2023-01-15 16:55:34 +0100
committerPierre Ossman <ossman@cendio.se>2023-02-04 14:03:13 +0100
commit2047dae22fb862ff43309ebb4fe2b9e7d6ce6153 (patch)
tree975687d97e31e677f827e0f586a349868e6a1e65 /win/vncconfig/Legacy.cxx
parentea6afa9b791e3782455a829f97515fa721edd522 (diff)
downloadtigervnc-2047dae22fb862ff43309ebb4fe2b9e7d6ce6153.tar.gz
tigervnc-2047dae22fb862ff43309ebb4fe2b9e7d6ce6153.zip
Return std::vector instead of dynamic allocation
This makes memory management more clear and robust when using these helper functions.
Diffstat (limited to 'win/vncconfig/Legacy.cxx')
-rw-r--r--win/vncconfig/Legacy.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/win/vncconfig/Legacy.cxx b/win/vncconfig/Legacy.cxx
index deba0ff3..3edfd4f7 100644
--- a/win/vncconfig/Legacy.cxx
+++ b/win/vncconfig/Legacy.cxx
@@ -19,7 +19,6 @@
#include <vncconfig/Legacy.h>
#include <rfb/LogWriter.h>
-#include <rfb/Password.h>
#include <rfb_win32/CurrentUser.h>
using namespace rfb;
@@ -212,9 +211,9 @@ void LegacyPage::LoadPrefs()
}
regKey.setInt(_T("QueryTimeout"), key.getInt(_T("QueryTimeout"), 10));
- ObfuscatedPasswd passwd;
- key.getBinary(_T("Password"), (void**)&passwd.buf, &passwd.length, 0, 0);
- regKey.setBinary(_T("Password"), passwd.buf, passwd.length);
+ std::vector<uint8_t> passwd;
+ passwd = key.getBinary(_T("Password"));
+ regKey.setBinary(_T("Password"), passwd.data(), passwd.size());
bool enableInputs = key.getBool(_T("InputsEnabled"), true);
regKey.setBool(_T("AcceptKeyEvents"), enableInputs);