Module: wine Branch: master Commit: eeb1826c3f15f4d705789332790cd5be3f1b1b7a URL: https://gitlab.winehq.org/wine/wine/-/commit/eeb1826c3f15f4d705789332790cd5b...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Sat Dec 2 22:42:52 2023 +0800
mciwave: Use matching memory allocator (Coverity).
*pszTmpFileName will be freed with free() but it's allocated with HeapAlloc().
---
dlls/mciwave/mciwave.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/dlls/mciwave/mciwave.c b/dlls/mciwave/mciwave.c index b17c347258f..f2af38b8762 100644 --- a/dlls/mciwave/mciwave.c +++ b/dlls/mciwave/mciwave.c @@ -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);