Because Fiddle::Pointer class was alloced with TypedData_Make_Struct macro, it must be freed with ruby_xfree.
Same applies to ext/fiddle/handle.c, ext/dl/cptr.c and ext/dl/handle.c
Here is a patch.
ext/dl/cptr.c (dlptr_free), ext/dl/handle.c (dlhandle_free),
ext/fiddle/handle.c (fiddle_handle_free),
ext/fiddle/pointer.c (fiddle_ptr_free): fix memory leak.
based on the patch Heesob Park at [ruby-dev:48021] [Bug #9599].
r40930 and r45298 were backported to ruby_2_0_0 (at r45371 and r45372) to resolv conflicts.
And I want to backport r45291, r45299, r45301, r45314, r45315 and r45325, but with them dl and fiddle tests fail. I wonder if there are any other memory leaks.