cutec-chris / dexif

Lazarus port of Delphi EXIF Library to extract Exif Information from Images
Other
21 stars 18 forks source link

Memory leak in dexifwrite #11

Open Mikkao opened 5 years ago

Mikkao commented 5 years ago

In dexifwrite line 298 the first item of ASubIFDList is deleted. TList.Delete does not free the memory. Since ASubIFDList is not a TList, but a TInt64List (dUtils, line 24), the procedure Notify must be overridden to prevent the memory leak:

procedure Notify(Ptr: Pointer; Action: TListNotification); override;

procedure TInt64List.Notify(Ptr: Pointer; Action: TListNotification); begin inherited; If Action = lnDeleted then Dispose(Ptr); end;