mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-31 18:29:02 -04:00
removed two instances of malloc(0) captured by new rs_malloc funtion
This commit is contained in:
parent
d13526facd
commit
d55993d1e4
35 changed files with 73 additions and 56 deletions
|
@ -748,7 +748,7 @@ bool ftController::copyFile(const std::string& source,const std::string& dest)
|
|||
size_t T=0;
|
||||
|
||||
static const int BUFF_SIZE = 10485760 ; // 10 MB buffer to speed things up.
|
||||
void *buffer = rs_safe_malloc(BUFF_SIZE) ;
|
||||
void *buffer = rs_malloc(BUFF_SIZE) ;
|
||||
|
||||
if(buffer == NULL)
|
||||
{
|
||||
|
|
|
@ -879,7 +879,7 @@ bool ftDataMultiplex::locked_handleServerRequest(ftFileProvider *provider, const
|
|||
std::cerr << "Warning: peer " << peerId << " is asking a large chunk (s=" << chunksize << ") for hash " << hash << ", filesize=" << size << ". This is unexpected." << std::endl ;
|
||||
return false ;
|
||||
}
|
||||
void *data = rs_safe_malloc(chunksize);
|
||||
void *data = rs_malloc(chunksize);
|
||||
|
||||
if(data == NULL)
|
||||
return false ;
|
||||
|
|
|
@ -1102,7 +1102,7 @@ bool ftServer::sendData(const RsPeerId& peerId, const RsFileHash& hash, uint64_t
|
|||
|
||||
item->chunk_offset = offset+baseoffset ;
|
||||
item->chunk_size = chunk;
|
||||
item->chunk_data = rs_safe_malloc(chunk) ;
|
||||
item->chunk_data = rs_malloc(chunk) ;
|
||||
|
||||
if(item->chunk_data == NULL)
|
||||
{
|
||||
|
|
|
@ -436,7 +436,7 @@ RsTurtleFileDataItem::RsTurtleFileDataItem(void *data,uint32_t pktsize)
|
|||
if(chunk_size > rssize || rssize - chunk_size < offset)
|
||||
throw std::runtime_error("RsTurtleFileDataItem::() error while deserializing.") ;
|
||||
|
||||
chunk_data = (void*)rs_safe_malloc(chunk_size) ;
|
||||
chunk_data = (void*)rs_malloc(chunk_size) ;
|
||||
|
||||
if(chunk_data == NULL)
|
||||
throw std::runtime_error("RsTurtleFileDataItem::() cannot allocate memory.") ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue