From 0c57d637d42e659815ab8d970b8635cc01b7aac0 Mon Sep 17 00:00:00 2001 From: Mark Somerville <mark@scottishclimbs.com> Date: Thu, 18 Feb 2010 12:04:35 +0000 Subject: [PATCH 3/6] 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. --- GD.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.1