mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
added a new method rs_malloc that checks its arguments and prints a stacktrace on error/weird call. Changed the code everywhere to use this instead of malloc. Removed some mallocs and replaced with RsTemporaryMemory
This commit is contained in:
parent
9c6e7dfc13
commit
d13526facd
39 changed files with 274 additions and 132 deletions
|
@ -290,7 +290,11 @@ bool getLocalAddresses(std::list<sockaddr_storage> & addrs)
|
|||
#ifdef WINDOWS_SYS
|
||||
// Seems strange to me but M$ documentation suggests to allocate this way...
|
||||
DWORD bf_size = 16000;
|
||||
IP_ADAPTER_ADDRESSES* adapter_addresses = (IP_ADAPTER_ADDRESSES*) malloc(bf_size);
|
||||
IP_ADAPTER_ADDRESSES* adapter_addresses = (IP_ADAPTER_ADDRESSES*) rs_safe_malloc(bf_size);
|
||||
|
||||
if(adapter_addresses == NULL)
|
||||
return false ;
|
||||
|
||||
DWORD error = GetAdaptersAddresses(AF_UNSPEC,
|
||||
GAA_FLAG_SKIP_MULTICAST |
|
||||
GAA_FLAG_SKIP_DNS_SERVER |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue