Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential TList leak in FindLastSameBlockByOperationsBlock in UNetProtocol.pas #244

Open
SkybuckFlying opened this issue Jan 27, 2022 · 0 comments

Comments

@SkybuckFlying
Copy link
Contributor

SkybuckFlying commented Jan 27, 2022

Potential TList leak, plus potential TPCOperationsComp leaks that were added to same TList via Do_GetOperationsBlock.

See *** for problem code.

Line 1587 start of function:

  Function FindLastSameBlockByOperationsBlock(min,max : Cardinal; var OperationBlock : TOperationBlock) : Boolean;
  var i : Integer;
    ant_nblock : Int64;
    auxBlock, sbBlock : TOperationBlock;
    distinctmax,distinctmin : Cardinal;
    BlocksList : TList<TPCOperationsComp>;
    errors : String;
  Begin
    Result := false;
    OperationBlock := CT_OperationBlock_NUL;
    repeat
      BlocksList := TList<TPCOperationsComp>.Create; // *** LIST CREATED ***
      try
        If Not Do_GetOperationsBlock(Nil,min,max,20000,true,BlocksList) then exit; // *** LIST NOT DESTROYED ***
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant