Description: Fixed a memory leak when creating a GD image from a file.
 The macro was incorrectly reopening the file, leaving it unreferenced
 and open after the GD image was created. Altered to use the Ruby
 function to reference the FILE pointer.
From: Mark Somerville <mark@scottishclimbs.com>
Origin: https://github.com/Spakman/ruby-gd/commit/0c57d637d42e659815ab8d970b8635cc01b7aac0
Last-Update: 2010-02-18

diff --git a/GD.c b/GD.c
index 16ad506..44bed15 100644
--- a/GD.c
+++ b/GD.c
@@ -29,7 +29,7 @@
 
 #if defined(HAVE_RUBY_IO_H) /* seems like Ruby > 1.8 */
         #define FPTR_TYPE rb_io_t
-        #define FILE_POINTER_FOR_CREATE_FROM fdopen(fptr->fd, "r")
+        #define FILE_POINTER_FOR_CREATE_FROM rb_io_stdio_file(fptr)
         #define FPTR_PATH (char*)fptr->pathv
         #define SECOND_FILE_POINTER rb_io_stdio_file(fptr)
 #else
-- 
1.8.5.1

