mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-20 04:14:27 -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
1 changed files with 2 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue