mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fixed memory leak in DistantChatService::locked_sendDHPublicKey.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8456 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
dc62965760
commit
5af0716a16
@ -656,15 +656,13 @@ void DistantChatService::handleRecvDHPublicKey(RsChatDHPublicKeyItem *item)
|
|||||||
|
|
||||||
bool DistantChatService::locked_sendDHPublicKey(const DH *dh,const RsGxsId& own_gxs_id,const RsPeerId& virtual_peer_id)
|
bool DistantChatService::locked_sendDHPublicKey(const DH *dh,const RsGxsId& own_gxs_id,const RsPeerId& virtual_peer_id)
|
||||||
{
|
{
|
||||||
RsChatDHPublicKeyItem *dhitem = new RsChatDHPublicKeyItem ;
|
|
||||||
|
|
||||||
if(dh == NULL)
|
if(dh == NULL)
|
||||||
{
|
{
|
||||||
std::cerr << " (EE) DH struct is not initialised! Error." << std::endl;
|
std::cerr << " (EE) DH struct is not initialised! Error." << std::endl;
|
||||||
delete dhitem ;
|
|
||||||
return false ;
|
return false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RsChatDHPublicKeyItem *dhitem = new RsChatDHPublicKeyItem ;
|
||||||
dhitem->public_key = BN_dup(dh->pub_key) ;
|
dhitem->public_key = BN_dup(dh->pub_key) ;
|
||||||
|
|
||||||
// we should also sign the data and check the signature on the other end.
|
// we should also sign the data and check the signature on the other end.
|
||||||
@ -689,6 +687,7 @@ bool DistantChatService::locked_sendDHPublicKey(const DH *dh,const RsGxsId& own_
|
|||||||
break ;
|
break ;
|
||||||
}
|
}
|
||||||
free(data) ;
|
free(data) ;
|
||||||
|
delete(dhitem);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
free(data) ;
|
free(data) ;
|
||||||
|
Loading…
Reference in New Issue
Block a user