Browse Source

Memory leak on RandomHash

Small memory leak fixed
PascalCoin 6 years ago
parent
commit
9146c3071b
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/core/URandomHash.pas

+ 1 - 0
src/core/URandomHash.pas

@@ -1002,6 +1002,7 @@ end;
 function TRandomHashFast.TChecksummedByteCollection.Clone : TChecksummedByteCollection;
 begin
   Result := TChecksummedByteCollection.Create;
+  FreeAndNil( Result.FBytes ); // Memory Leak prevention prior to create new structure
   Result.FBytes := TList<TBytes>.Create(Self.FBytes);
   Result.FComputedIndex:= Self.FComputedIndex;
   Result.FChecksum:= Self.FChecksum;