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