Skip to content

Commit

Permalink
Fixed off-by-one bug that led to constant buffer leaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Laksen committed Aug 15, 2015
1 parent ffb7245 commit 1593323
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fpethbuf.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

interface

{$mode objfpc}
{$modeswitch AdvancedRecords}

type
Expand Down Expand Up @@ -525,7 +526,7 @@ procedure TBuffer.DecRef;
Dec(p^.RefCnt);
end;

if OldCnt < 1 then
if OldCnt <= 1 then
p^.Free;

p:=p2;
Expand Down

0 comments on commit 1593323

Please sign in to comment.