* fix 2 memory leaks in MacOS resource fork handler, Savannah bug #16631
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
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;
}