Commit 3f9f4a4a authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

ipconfig: Use CRT allocation functions.

parent dcb16021
...@@ -45,13 +45,13 @@ static int ipconfig_vprintfW(const WCHAR *msg, va_list va_args) ...@@ -45,13 +45,13 @@ static int ipconfig_vprintfW(const WCHAR *msg, va_list va_args)
*/ */
len = WideCharToMultiByte(GetOEMCP(), 0, msg_buffer, wlen, len = WideCharToMultiByte(GetOEMCP(), 0, msg_buffer, wlen,
NULL, 0, NULL, NULL); NULL, 0, NULL, NULL);
msgA = HeapAlloc(GetProcessHeap(), 0, len); msgA = malloc(len);
if (!msgA) if (!msgA)
return 0; return 0;
WideCharToMultiByte(GetOEMCP(), 0, msg_buffer, wlen, msgA, len, NULL, NULL); WideCharToMultiByte(GetOEMCP(), 0, msg_buffer, wlen, msgA, len, NULL, NULL);
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), msgA, len, &count, FALSE); WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), msgA, len, &count, FALSE);
HeapFree(GetProcessHeap(), 0, msgA); free(msgA);
} }
return count; return count;
...@@ -146,7 +146,7 @@ static void print_basic_information(void) ...@@ -146,7 +146,7 @@ static void print_basic_information(void)
if (GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_GATEWAYS, if (GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_GATEWAYS,
NULL, NULL, &out) == ERROR_BUFFER_OVERFLOW) NULL, NULL, &out) == ERROR_BUFFER_OVERFLOW)
{ {
adapters = HeapAlloc(GetProcessHeap(), 0, out); adapters = malloc(out);
if (!adapters) if (!adapters)
exit(1); exit(1);
...@@ -194,7 +194,7 @@ static void print_basic_information(void) ...@@ -194,7 +194,7 @@ static void print_basic_information(void)
} }
} }
HeapFree(GetProcessHeap(), 0, adapters); free(adapters);
} }
} }
...@@ -265,7 +265,7 @@ static void print_full_information(void) ...@@ -265,7 +265,7 @@ static void print_full_information(void)
if (GetNetworkParams(NULL, &out) == ERROR_BUFFER_OVERFLOW) if (GetNetworkParams(NULL, &out) == ERROR_BUFFER_OVERFLOW)
{ {
info = HeapAlloc(GetProcessHeap(), 0, out); info = malloc(out);
if (!info) if (!info)
exit(1); exit(1);
...@@ -288,13 +288,13 @@ static void print_full_information(void) ...@@ -288,13 +288,13 @@ static void print_full_information(void)
ipconfig_printfW(L"\n"); ipconfig_printfW(L"\n");
} }
HeapFree(GetProcessHeap(), 0, info); free(info);
} }
if (GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_GATEWAYS, if (GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_GATEWAYS,
NULL, NULL, &out) == ERROR_BUFFER_OVERFLOW) NULL, NULL, &out) == ERROR_BUFFER_OVERFLOW)
{ {
adapters = HeapAlloc(GetProcessHeap(), 0, out); adapters = malloc(out);
if (!adapters) if (!adapters)
exit(1); exit(1);
...@@ -348,7 +348,7 @@ static void print_full_information(void) ...@@ -348,7 +348,7 @@ static void print_full_information(void)
} }
} }
HeapFree(GetProcessHeap(), 0, adapters); free(adapters);
} }
} }
......
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