mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-01 10:46:23 -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
|
@ -351,7 +351,7 @@ void SpeexOutputProcessor::putNetworkPacket(QString name, QByteArray packet) {
|
|||
if (userJitterHash.contains(name)) {
|
||||
userJitter = userJitterHash.value(name);
|
||||
} else {
|
||||
userJitter = (SpeexJitter*)rs_safe_malloc(sizeof(SpeexJitter));
|
||||
userJitter = (SpeexJitter*)rs_malloc(sizeof(SpeexJitter));
|
||||
|
||||
if(!userJitter)
|
||||
return ;
|
||||
|
|
|
@ -386,7 +386,7 @@ bool JPEGVideo::encodeData(const QImage& image,uint32_t /* size_hint */,RsVOIPDa
|
|||
buffer.open(QIODevice::WriteOnly) ;
|
||||
encoded_frame.save(&buffer,"JPEG") ;
|
||||
|
||||
voip_chunk.data = rs_safe_malloc(HEADER_SIZE + qb.size());
|
||||
voip_chunk.data = rs_malloc(HEADER_SIZE + qb.size());
|
||||
|
||||
if(!voip_chunk.data)
|
||||
return false ;
|
||||
|
@ -684,7 +684,7 @@ bool FFmpegVideo::encodeData(const QImage& image, uint32_t target_encoding_bitra
|
|||
|
||||
if(got_output)
|
||||
{
|
||||
voip_chunk.data = rs_safe_malloc(pkt.size + HEADER_SIZE) ;
|
||||
voip_chunk.data = rs_malloc(pkt.size + HEADER_SIZE) ;
|
||||
|
||||
if(!voip_chunk.data)
|
||||
return false ;
|
||||
|
|
|
@ -280,7 +280,7 @@ int p3VOIP::sendVoipData(const RsPeerId& peer_id,const RsVOIPDataChunk& chunk)
|
|||
std::cerr << "Cannot allocate RsVOIPDataItem !" << std::endl;
|
||||
return false ;
|
||||
}
|
||||
item->voip_data = rs_safe_malloc(chunk.size) ;
|
||||
item->voip_data = rs_malloc(chunk.size) ;
|
||||
|
||||
if(item->voip_data == NULL)
|
||||
{
|
||||
|
@ -431,7 +431,7 @@ bool p3VOIP::getIncomingData(const RsPeerId& peer_id,std::vector<RsVOIPDataChunk
|
|||
{
|
||||
RsVOIPDataChunk chunk ;
|
||||
chunk.size = (*it2)->data_size ;
|
||||
chunk.data = rs_safe_malloc((*it2)->data_size) ;
|
||||
chunk.data = rs_malloc((*it2)->data_size) ;
|
||||
|
||||
if(chunk.data == NULL)
|
||||
{
|
||||
|
|
|
@ -450,7 +450,7 @@ RsVOIPDataItem::RsVOIPDataItem(void *data, uint32_t pktsize)
|
|||
if(data_size > rssize || rssize - data_size < offset)
|
||||
throw std::runtime_error("Not enough space.") ;
|
||||
|
||||
voip_data = rs_safe_malloc(data_size) ;
|
||||
voip_data = rs_malloc(data_size) ;
|
||||
|
||||
if(!voip_data)
|
||||
throw std::runtime_error("Serialization error.") ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue