fix the 2nd part of Savannah bug #16590
diff --git a/ChangeLog b/ChangeLog
index 0032396..e6f25fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-05-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
+ * src/base/ftmac.c (open_face_from_buffer): Deallocate stream when
+ its content cannot be parsed as supported font. This fixes
+ the second part of Savannah bug #16590.
+
2006-05-18 Werner Lemberg <wl@gnu.org>
* src/truetype/ttgload.c (TT_Load_Composite_Glyph)
diff --git a/src/base/ftmac.c b/src/base/ftmac.c
index 6e4cbe5..e8c24d8 100644
--- a/src/base/ftmac.c
+++ b/src/base/ftmac.c
@@ -1010,6 +1010,8 @@
error = FT_Open_Face( library, &args, face_index, aface );
if ( error == FT_Err_Ok )
(*aface)->face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM;
+ else
+ FT_Stream_Free( stream, 0 );
return error;
}