@nicolas-cellier-aka-nice commented on this pull request.
LPVOID lpFileInformation,
- DWORD dwBufferSize - ); - static pfnGetFileInformationByHandleEx pGetFileInformationByHandleEx = NULL; - if (!pGetFileInformationByHandleEx) { - pGetFileInformationByHandleEx = (pfnGetFileInformationByHandleEx) - GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetFileInformationByHandleEx"); - if (!pGetFileInformationByHandleEx) - return -1; - } - - nameinfo = malloc(size); - if (nameinfo == NULL) { - return -1; - } + nameinfo = alloca(size);
Why not, alloca is a bit shorter, but the pairs of malloc and free seems correct here... I'd rather consider this change as un-necessary.