Commit 810bde3b authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

extrac32: Use CRT allocation functions.

parent 6db69d02
...@@ -136,13 +136,12 @@ static LPWSTR *get_extrac_args(LPWSTR cmdline, int *pargc) ...@@ -136,13 +136,12 @@ static LPWSTR *get_extrac_args(LPWSTR cmdline, int *pargc)
BOOL new_arg; BOOL new_arg;
WINE_TRACE("cmdline: %s\n", wine_dbgstr_w(cmdline)); WINE_TRACE("cmdline: %s\n", wine_dbgstr_w(cmdline));
str = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(cmdline) + 1) * sizeof(WCHAR)); str = wcsdup(cmdline);
if(!str) return NULL; if(!str) return NULL;
lstrcpyW(str, cmdline); argv = malloc((max_argc + 1) * sizeof(WCHAR*));
argv = HeapAlloc(GetProcessHeap(), 0, (max_argc + 1) * sizeof(LPWSTR));
if(!argv) if(!argv)
{ {
HeapFree(GetProcessHeap(), 0, str); free(str);
return NULL; return NULL;
} }
...@@ -192,11 +191,10 @@ static LPWSTR *get_extrac_args(LPWSTR cmdline, int *pargc) ...@@ -192,11 +191,10 @@ static LPWSTR *get_extrac_args(LPWSTR cmdline, int *pargc)
/* Realloc argv here because there always should be /* Realloc argv here because there always should be
at least one reserved cell for terminating NULL */ at least one reserved cell for terminating NULL */
max_argc *= 2; max_argc *= 2;
argv = HeapReAlloc(GetProcessHeap(), 0, argv, argv = realloc(argv, (max_argc + 1) * sizeof(WCHAR*));
(max_argc + 1) * sizeof(LPWSTR));
if(!argv) if(!argv)
{ {
HeapFree(GetProcessHeap(), 0, str); free(str);
return NULL; return NULL;
} }
} }
......
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