mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-25 15:35:49 -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
|
@ -24,6 +24,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "util/rsmemory.h"
|
||||
#include "serialiser/rstlvbinary.h"
|
||||
|
||||
#include "serialiser/rstlvbase.h"
|
||||
|
@ -74,7 +75,11 @@ bool RsTlvBinaryData::setBinData(const void *data, uint32_t size)
|
|||
return true;
|
||||
}
|
||||
|
||||
bin_data = malloc(bin_len);
|
||||
bin_data = rs_safe_malloc(bin_len);
|
||||
|
||||
if(bin_data == NULL)
|
||||
return false ;
|
||||
|
||||
memcpy(bin_data, data, bin_len);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue