mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-01 12:24:36 -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
|
@ -1141,7 +1141,7 @@ bool p3GxsTunnelService::locked_sendClearTunnelData(RsGxsTunnelDHPublicKeyItem *
|
|||
uint32_t rssize = item->serial_size() ;
|
||||
|
||||
gitem->data_size = rssize + 8 ;
|
||||
gitem->data_bytes = rs_safe_malloc(rssize+8) ;
|
||||
gitem->data_bytes = rs_malloc(rssize+8) ;
|
||||
|
||||
if(gitem->data_bytes == NULL)
|
||||
{
|
||||
|
@ -1231,7 +1231,7 @@ bool p3GxsTunnelService::locked_sendEncryptedTunnelData(RsGxsTunnelItem *item)
|
|||
RsTurtleGenericDataItem *gitem = new RsTurtleGenericDataItem ;
|
||||
|
||||
gitem->data_size = encrypted_size + GXS_TUNNEL_ENCRYPTION_IV_SIZE + GXS_TUNNEL_ENCRYPTION_HMAC_SIZE ;
|
||||
gitem->data_bytes = rs_safe_malloc(gitem->data_size) ;
|
||||
gitem->data_bytes = rs_malloc(gitem->data_size) ;
|
||||
|
||||
if(gitem->data_bytes == NULL)
|
||||
return false ;
|
||||
|
@ -1329,7 +1329,7 @@ bool p3GxsTunnelService::sendData(const RsGxsTunnelId &tunnel_id, uint32_t servi
|
|||
item->flags = 0; // not used yet.
|
||||
item->service_id = service_id;
|
||||
item->data_size = size; // encrypted data size
|
||||
item->data = (uint8_t*)rs_safe_malloc(size); // encrypted data
|
||||
item->data = (uint8_t*)rs_malloc(size); // encrypted data
|
||||
|
||||
if(item->data == NULL)
|
||||
delete item ;
|
||||
|
|
|
@ -394,7 +394,7 @@ RsGxsTunnelDataItem *RsGxsTunnelSerialiser::deserialise_RsGxsTunnelDataItem(void
|
|||
delete item ;
|
||||
return NULL ;
|
||||
}
|
||||
item->data = (unsigned char*)rs_safe_malloc(item->data_size) ;
|
||||
item->data = (unsigned char*)rs_malloc(item->data_size) ;
|
||||
|
||||
if(item->data == NULL)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue