Commit de0a96c5dd7f8156f684c10c32462b28dcfe29d3

Suzuki, Toshiya (鈴木俊哉) 2006-05-19T23:16:12

* fix 2 memory leaks in MacOS resource fork handler, Savannah bug #16631

diff --git a/ChangeLog b/ChangeLog
index 8c91fc7..5230dc8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2006-05-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
+	Apply patch by Derek Clegg to fix 2 memory leak in MacOS resource
+	fork handler, Savannah bug #16631.
+
+	* src/base/ftobjs.c (load_face_in_embedded_rfork):
+	Replace FT_Stream_Close() by FT_Stream_Free() to fix memory leak.
+
+	* src/base/ftrfrk.c (raccess_guess_linux_double_from_file_name):
+	Replace FT_Stream_Close() by FT_Stream_Free() to fix memory leak.
+
+2006-05-19  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
 	* build/unix/configure.raw: Add a fallback to disable Carbon
 	dependency, if configured with no options on Mac OS X.
 
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index a7d82de..6e3f439 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1531,7 +1531,7 @@
 
       error = IsMacResource( library, stream2, offsets[i],
                              face_index, aface );
-      FT_Stream_Close( stream2 );
+      FT_Stream_Free( stream2, 0 );
 
       FT_TRACE3(( "%s\n", error ? "failed": "successful" ));
 
diff --git a/src/base/ftrfork.c b/src/base/ftrfork.c
index cfa5891..a4f726d 100644
--- a/src/base/ftrfork.c
+++ b/src/base/ftrfork.c
@@ -647,7 +647,7 @@
     error = raccess_guess_apple_double( library, stream2, file_name,
                                         &nouse, result_offset );
 
-    FT_Stream_Close( stream2 );
+    FT_Stream_Free( stream2, 0 );
 
     return error;
   }