EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Memory leak in SRPContext

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#6520
Posted: 06/06/2008 22:09:16
by Scratch  (Standard support level)
Joined: 02/07/2008
Posts: 34

Dunno about v.6 but in v.5 there's a huge memory leak in TSRPContext. Noticed that when assigned ServerIOHandler to Indy. The problem is that
SrpInitContext does not have corresponding
SrpDestroyContext.
In SBPublicKeyCrypto there's
constructor TElSRPKeyMaterial.Create which calls
SrpInitContext
and
destructor TElSRPKeyMaterial.Destoy;
which just calls inherited.
I've added
Code

procedure SrpDestroyContext(var SRP:TSRPContext);
begin
      LDestroy(SRP.Salt);
      LDestroy(SRP.N);
      LDestroy(SRP.G);
      LDestroy(SRP.X);
      LDestroy(SRP.A);
      LDestroy(SRP.K);
      LDestroy(SRP.A_small);
      LDestroy(SRP.B);
      LDestroy(SRP.B_small);
      LDestroy(SRP.V);
      LDestroy(SRP.U);
      LDestroy(SRP.S);
      Srp.Initialized :=true;
end;


and referenced it in TElSRPKeyMaterial.Destoy;
Now it's all ok )
#6521
Posted: 06/07/2008 00:53:41
by Eugene Mayevski (EldoS Corp.)

Thank you for the report.
I can't say about SBB 5, since it's outdated, but in SBB 6 everything that you descrbe is already done.


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 992 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!