Module: wine Branch: master Commit: 5675994602c8758756a7f94becd1b8d8a6a7e70d URL: https://source.winehq.org/git/wine.git/?a=commit;h=5675994602c8758756a7f94be...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Sun Jul 3 15:50:09 2022 +0300
winepath: Use CRT allocation functions.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
---
programs/winepath/winepath.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/programs/winepath/winepath.c b/programs/winepath/winepath.c index 17cfdc1d2eb..88c64b91a42 100644 --- a/programs/winepath/winepath.c +++ b/programs/winepath/winepath.c @@ -195,7 +195,7 @@ int __cdecl wmain(int argc, WCHAR *argv[]) if (outputformats & UNIXFORMAT) { WCHAR *ntpath, *tail; int ntpathlen=lstrlenW(argv[i]); - ntpath=HeapAlloc(GetProcessHeap(), 0, sizeof(*ntpath)*(ntpathlen+1)); + ntpath = malloc(sizeof(*ntpath)*(ntpathlen+1)); lstrcpyW(ntpath, argv[i]); tail=NULL; while (1) @@ -215,7 +215,7 @@ int __cdecl wmain(int argc, WCHAR *argv[]) { printf("%s%c", unix_name, separator); } - HeapFree( GetProcessHeap(), 0, unix_name ); + free( unix_name ); break; }
@@ -247,7 +247,7 @@ int __cdecl wmain(int argc, WCHAR *argv[]) tail=slash; *tail='\0'; } - HeapFree(GetProcessHeap(), 0, ntpath); + free(ntpath); } if (outputformats & WINDOWSFORMAT) { WCHAR* windows_name; @@ -255,17 +255,17 @@ int __cdecl wmain(int argc, WCHAR *argv[]) DWORD size;
size=WideCharToMultiByte(CP_UNIXCP, 0, argv[i], -1, NULL, 0, NULL, NULL); - unix_name=HeapAlloc(GetProcessHeap(), 0, size); + unix_name = malloc(size); WideCharToMultiByte(CP_UNIXCP, 0, argv[i], -1, unix_name, size, NULL, NULL);
if ((windows_name = wine_get_dos_file_name_ptr(unix_name))) { WideCharToMultiByte(CP_UNIXCP, 0, windows_name, -1, path, MAX_PATH, NULL, NULL); printf("%s%c", path, separator); - HeapFree( GetProcessHeap(), 0, windows_name ); + free( windows_name ); } else printf("%c", separator); - HeapFree( GetProcessHeap(), 0, unix_name ); + free( unix_name ); } }