From: Bernhard Übelacker <bernhardu@mailbox.org> Followup of 929b2a19cb. Found by ASan. --- dlls/wbemdisp/locator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/wbemdisp/locator.c b/dlls/wbemdisp/locator.c index c3ad6fa50a2..ab58c5c2b0a 100644 --- a/dlls/wbemdisp/locator.c +++ b/dlls/wbemdisp/locator.c @@ -3714,7 +3714,8 @@ static HRESULT WINAPI objectpath_get_DisplayName( ISWbemObjectPath *iface, BSTR FIXME( "%p, %p semi-stub\n", objectpath, strDisplayName ); if (FAILED( hr = IWbemPath_GetText( objectpath->path, WBEMPATH_GET_SERVER_TOO, &len, NULL ) )) return hr; - if (!(buf = SysAllocStringLen( L"winmgmts:", len + ARRAY_SIZE( L"winmgmts:" ) - 2 ) )) return E_OUTOFMEMORY; + if (!(buf = SysAllocStringLen( NULL, len + ARRAY_SIZE( L"winmgmts:" ) - 2 ) )) return E_OUTOFMEMORY; + lstrcpyW( buf, L"winmgmts:" ); /* TODO: add 'authenticationLevel' and 'impersonationLevel' from the security object. Native also * includes 'Name', 'SoftwareElementID', 'SoftwareElementState' and 'TargetOperatingSystem' values. * The last three are currently missing from the properties. */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11733