Commit 56759946 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

winepath: Use CRT allocation functions.

parent ee1f96eb
......@@ -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 );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment