diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-09-06 01:10:15 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-09-06 01:10:15 +0100 |
commit | e7d3a1a665d1204d15b00fdbe6716b43d8ef3b4a (patch) | |
tree | a433d42a5c16bbeb75709ca590b9235fc8350e96 /toxcore/LAN_discovery.c | |
parent | 8121ace449d552d53798ca768a74b9be112c7b8b (diff) |
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.
Diffstat (limited to 'toxcore/LAN_discovery.c')
-rw-r--r-- | toxcore/LAN_discovery.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/LAN_discovery.c b/toxcore/LAN_discovery.c index 4edc960a..f0b12a3e 100644 --- a/toxcore/LAN_discovery.c +++ b/toxcore/LAN_discovery.c | |||
@@ -49,8 +49,8 @@ static void fetch_broadcast_info(uint16_t port) | |||
49 | { | 49 | { |
50 | broadcast_count = 0; | 50 | broadcast_count = 0; |
51 | 51 | ||
52 | IP_ADAPTER_INFO *pAdapterInfo = malloc(sizeof(pAdapterInfo)); | 52 | IP_ADAPTER_INFO *pAdapterInfo = malloc(sizeof(IP_ADAPTER_INFO)); |
53 | unsigned long ulOutBufLen = sizeof(pAdapterInfo); | 53 | unsigned long ulOutBufLen = sizeof(IP_ADAPTER_INFO); |
54 | 54 | ||
55 | if (pAdapterInfo == NULL) { | 55 | if (pAdapterInfo == NULL) { |
56 | return; | 56 | return; |