mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04: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
|
@ -433,6 +433,13 @@ bool p3VOIP::getIncomingData(const RsPeerId& peer_id,std::vector<RsVOIPDataChunk
|
|||
RsVOIPDataChunk chunk ;
|
||||
chunk.size = (*it2)->data_size ;
|
||||
chunk.data = malloc((*it2)->data_size) ;
|
||||
|
||||
if(chunk.data == NULL)
|
||||
{
|
||||
std::cerr << "(EE) p3VOIP::getIncomingData(): error. Cannot allocate memory for chunk of size " << chunk.size << std::endl;
|
||||
delete *it2 ;
|
||||
continue ;
|
||||
}
|
||||
|
||||
uint32_t type_flags = (*it2)->flags & (RS_VOIP_FLAGS_AUDIO_DATA | RS_VOIP_FLAGS_VIDEO_DATA) ;
|
||||
if(type_flags == RS_VOIP_FLAGS_AUDIO_DATA)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue