Ok, my fault. There is no error in the patch of wine/dlls/ntdll/path.c which was checked in.
The patch has the line
+ if (!newname) RtlFreeHeap(GetProcessHeap(), 0, name);
instead of that I read
+ if (newname) RtlFreeHeap(GetProcessHeap(), 0, name);
which changes the meaning from
If the RtlReAllocateHeap fails, release the memory of name and set name to NULL.
to
If the RtlReAllocateHeap succeeds, throw the memory of name away.
Which looks like somebody did not understand RtlReAllocateHeap. The only one who did not understand, was me.
I apologize Thomas Mertes