fixed a potential memory leak. oopsie!
This commit is contained in:
parent
d42da07721
commit
e8ec7382af
1 changed files with 2 additions and 0 deletions
|
|
@ -28,8 +28,10 @@ void AuthProfileManager::load()
|
|||
auto readWstr = [&file]() -> wstring {
|
||||
uint16_t len = 0;
|
||||
file.read(reinterpret_cast<char *>(&len), sizeof(len));
|
||||
if (!file || len > 4096) return {};
|
||||
wstring s(len, L'\0');
|
||||
file.read(reinterpret_cast<char *>(s.data()), len * sizeof(wchar_t));
|
||||
if (!file) return {};
|
||||
return s;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue