mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-07 16:45:11 -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
|
@ -26,6 +26,7 @@
|
|||
#include "udprelay.h"
|
||||
#include <iostream>
|
||||
#include <time.h>
|
||||
#include <util/rsmemory.h>
|
||||
|
||||
/*
|
||||
* #define DEBUG_UDP_RELAY 1
|
||||
|
@ -70,7 +71,7 @@ UdpRelayReceiver::UdpRelayReceiver(UdpPublisher *pub)
|
|||
setRelayClassMax(UDP_RELAY_CLASS_GENERAL, UDP_RELAY_DEFAULT_GENERAL, UDP_RELAY_DEFAULT_BANDWIDTH);
|
||||
|
||||
/* only allocate this space once */
|
||||
mTmpSendPkt = malloc(MAX_RELAY_UDP_PACKET_SIZE);
|
||||
mTmpSendPkt = rs_safe_malloc(MAX_RELAY_UDP_PACKET_SIZE);
|
||||
mTmpSendSize = MAX_RELAY_UDP_PACKET_SIZE;
|
||||
|
||||
clearDataTransferred();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue