gtk_clipboard_wait_for_contents resource leak (gtk2proc.inc)
* Lazarus/FPC Version: trunk * Operating System: Linux 64-bit When gtk_clipboard_wait_for_contents is called from gtk2proc.inc, the code is not capturing the return value. [gtk_clipboard_wait_for_contents (gtk2proc.inc)](https://gitlab.com/freepascal.org/lazarus/lazarus/-/blob/main/lcl/interfaces/gtk2/gtk2proc.inc?ref_type=heads#L7637) ``` if WaitForClipboardAnswer(EventData) then begin gtk_clipboard_wait_for_contents(gtk_clipboard_get(TypeAtom), FormatID); Result:=EventData^.Data; end; ``` According to the docs if it returns non-NULL, the returned GtkSelectionData object must be freed. https://developer-old.gnome.org/gtk2/stable/gtk2-Clipboards.html#gtk-clipboard-wait-for-contents > Returns > a newly-allocated GtkSelectionData object or NULL if retrieving the given target failed. **If non-NULL, this value must be freed** with gtk_selection_data_free() when you are finished with it. Forum Ref: https://forum.lazarus.freepascal.org/index.php?topic=64557.msg490975
issue