mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
fixed a bug in GRouterGenericDataItem::duplicate()
This commit is contained in:
parent
2a8fc7fe01
commit
60408b3799
1 changed files with 7 additions and 6 deletions
|
@ -346,12 +346,13 @@ RsGRouterGenericDataItem *RsGRouterGenericDataItem::duplicate() const
|
|||
|
||||
// then duplicate the memory chunk
|
||||
|
||||
item->data_bytes = (uint8_t*)rs_malloc(data_size) ;
|
||||
|
||||
if(item->data_bytes == NULL)
|
||||
return NULL ;
|
||||
|
||||
memcpy(item->data_bytes,data_bytes,data_size) ;
|
||||
if(data_size > 0)
|
||||
{
|
||||
item->data_bytes = (uint8_t*)rs_malloc(data_size) ;
|
||||
memcpy(item->data_bytes,data_bytes,data_size) ;
|
||||
}
|
||||
else
|
||||
item->data_bytes = NULL ;
|
||||
|
||||
return item ;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue