fixed a potential memory leak. oopsie!

This commit is contained in:
Matthew Toro 2026-03-29 16:39:12 -04:00
parent d42da07721
commit e8ec7382af

View file

@ -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;
};