EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Memory leak in SRPContext

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#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 (Team)

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 1005 times

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




|

Back to top

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

Got it!