瀏覽代碼

Memory leak on RandomHash

Small memory leak fixed
PascalCoin 6 年之前
父節點
當前提交
9146c3071b
共有 1 個文件被更改,包括 1 次插入0 次删除
  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;