mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 22:25:04 -04:00
fixed malloc problem when chat avatar is missing
This commit is contained in:
parent
e726bd1061
commit
23156ab4b1
1 changed files with 6 additions and 0 deletions
|
@ -169,6 +169,12 @@ class p3ChatService::AvatarInfo
|
|||
|
||||
void toUnsignedChar(unsigned char *& data,uint32_t& size) const
|
||||
{
|
||||
if(_image_size == 0)
|
||||
{
|
||||
size = 0 ;
|
||||
data = NULL ;
|
||||
return ;
|
||||
}
|
||||
data = (unsigned char *)rs_malloc(_image_size) ;
|
||||
size = _image_size ;
|
||||
memcpy(data,_image_data,size*sizeof(unsigned char)) ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue