mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-29 20:06:38 -05:00
added checks after mallocs in several files
This commit is contained in:
parent
46520b0e22
commit
9c6e7dfc13
15 changed files with 157 additions and 12 deletions
|
|
@ -1922,6 +1922,12 @@ bool p3GRouter::sendData(const RsGxsId& destination,const GRouterServiceId& clie
|
|||
RsGRouterGenericDataItem *data_item = new RsGRouterGenericDataItem ;
|
||||
|
||||
data_item->data_bytes = (uint8_t*)malloc(data_size) ;
|
||||
|
||||
if(data_item->data_bytes == NULL)
|
||||
{
|
||||
std::cerr << "(EE) memory allocaiton error for " << data_size << " bytes in " << __PRETTY_FUNCTION__<< std::endl;
|
||||
return false ;
|
||||
}
|
||||
memcpy(data_item->data_bytes,data,data_size) ;
|
||||
|
||||
data_item->data_size = data_size ;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue