This is necessary if a protection software hooks LdrLoadDll, and then tries to use LoadLibrary[Ex]A from the hook. Yes, this actually happened.
--
v3: kernelbase: Make LoadLibraryExA allocate a new buffer for the module name.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8324