http://bugs.winehq.org/show_bug.cgi?id=57230
--- Comment #3 from Panayiotis Talianos panintended.foss@gmail.com --- This patch (authored by Yuxuan Shui) fixes the issue: https://gitlab.winehq.org/wine/wine/-/merge_requests/8214
FYI, the "Out of memory" error message is misleading. There is actually a failure to (re-)allocate memory, RtlReAllocateHeap sets the heap status to STATUS_INVALID_PARAMETER because of an invalid pointer (holding an address that lies within a now-freed block) being passed to it.