mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-19 03:49:29 -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
|
// then duplicate the memory chunk
|
||||||
|
|
||||||
item->data_bytes = (uint8_t*)rs_malloc(data_size) ;
|
if(data_size > 0)
|
||||||
|
{
|
||||||
if(item->data_bytes == NULL)
|
item->data_bytes = (uint8_t*)rs_malloc(data_size) ;
|
||||||
return NULL ;
|
memcpy(item->data_bytes,data_bytes,data_size) ;
|
||||||
|
}
|
||||||
memcpy(item->data_bytes,data_bytes,data_size) ;
|
else
|
||||||
|
item->data_bytes = NULL ;
|
||||||
|
|
||||||
return item ;
|
return item ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue