mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-09 06:42:19 -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
|
@ -450,7 +450,11 @@ RsVOIPDataItem::RsVOIPDataItem(void *data, uint32_t pktsize)
|
|||
if(data_size > rssize || rssize - data_size < offset)
|
||||
throw std::runtime_error("Not enough space.") ;
|
||||
|
||||
voip_data = malloc(data_size) ;
|
||||
voip_data = rs_safe_malloc(data_size) ;
|
||||
|
||||
if(!voip_data)
|
||||
throw std::runtime_error("Serialization error.") ;
|
||||
|
||||
memcpy(voip_data,&((uint8_t*)data)[offset],data_size) ;
|
||||
offset += data_size ;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue