mciwave: Use matching memory allocator (Coverity).

*pszTmpFileName will be freed with free() but it's allocated with HeapAlloc().
This commit is contained in:
Zhiyi Zhang 2023-12-02 22:42:52 +08:00 committed by Alexandre Julliard
parent c93440b700
commit eeb1826c3f

View file

@ -432,9 +432,7 @@ static DWORD create_tmp_file(HMMIO* hFile, LPWSTR* pszTmpFileName)
return MCIERR_FILE_NOT_FOUND;
}
*pszTmpFileName = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY,
MAX_PATH * sizeof(WCHAR));
*pszTmpFileName = calloc(1, MAX_PATH * sizeof(WCHAR));
if (!GetTempFileNameW(szTmpPath, szPrefix, 0, *pszTmpFileName)) {
WARN("can't retrieve temp file name!\n");
free(*pszTmpFileName);