Allocate sizeof(IP_ADAPTER_INFO) bytes instead of sizeof(T*).

https://msdn.microsoft.com/en-gb/library/windows/desktop/aa365917(v=vs.85).aspx
shows an example use of GetAdaptersInfo that does it this way.
This commit is contained in:
iphydf 2016-09-06 01:10:15 +01:00
parent 8121ace449
commit e7d3a1a665
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9

View File

@ -49,8 +49,8 @@ static void fetch_broadcast_info(uint16_t port)
{
broadcast_count = 0;
IP_ADAPTER_INFO *pAdapterInfo = malloc(sizeof(pAdapterInfo));
unsigned long ulOutBufLen = sizeof(pAdapterInfo);
IP_ADAPTER_INFO *pAdapterInfo = malloc(sizeof(IP_ADAPTER_INFO));
unsigned long ulOutBufLen = sizeof(IP_ADAPTER_INFO);
if (pAdapterInfo == NULL) {
return;