Skip to content

Commit

Permalink
Allocate sizeof(IP_ADAPTER_INFO) bytes instead of sizeof(T*).
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
iphydf committed Sep 6, 2016
1 parent 8121ace commit e7d3a1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions toxcore/LAN_discovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e7d3a1a

Please sign in to comment.