From: Anders Kjersem <andersdev@proton.me> --- dlls/wshom.ocx/shell.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/wshom.ocx/shell.c b/dlls/wshom.ocx/shell.c index 525dec7f932..c9192bf5d60 100644 --- a/dlls/wshom.ocx/shell.c +++ b/dlls/wshom.ocx/shell.c @@ -1852,10 +1852,11 @@ static HRESULT WINAPI WshShell3_AppActivate(IWshShell3 *iface, VARIANT *App, VAR UINT lenFind = lstrlenW(bsFind); for (; hWnd && !hWndTarget && lenFind; hWnd = GetWindow(hWnd, GW_HWNDNEXT)) { + BSTR bsBuf; UINT cch = GetWindowTextLengthW(hWnd); if (!cch) continue; - BSTR bsBuf = SysAllocStringLen(NULL, ++cch); + bsBuf = SysAllocStringLen(NULL, ++cch); if (!bsBuf) { hr = E_OUTOFMEMORY; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11157