mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
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:
parent
8121ace449
commit
e7d3a1a665
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user