Commit b68e025c1b888a1d06e3617d768d616d5469f754

Suzuki, Toshiya (鈴木俊哉) 2007-02-20T02:37:36

* Fix memory leak in ftmac.c, patch by Jjgod Jiang

diff --git a/ChangeLog b/ChangeLog
index 6f202b9..be4712b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-02-20  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+	* src/base/ftmac.c (FT_GetFileRef_From_Mac_ATS_Name): Fix memory
+	leak, patch by "Jjgod Jiang" <gzjjgod@gmail.com>.
+	* builds/mac/ftmac.c (FT_GetFileRef_From_Mac_ATS_Name): Ditto.
+
 2007-02-16  Werner Lemberg  <wl@gnu.org>
 
 	* src/truetype/ttinterp.c (Ins_MD): Remove unused variable.
diff --git a/builds/mac/ftmac.c b/builds/mac/ftmac.c
index 4c0788f..d6a8558 100644
--- a/builds/mac/ftmac.c
+++ b/builds/mac/ftmac.c
@@ -283,6 +283,7 @@
                                              kCFStringEncodingMacRoman );
     ats_font_id = ATSFontFindFromName( cf_fontName,
                                        kATSOptionFlagsUnRestrictedScope );
+    CFRelease(cf_fontName);
 
     if ( ats_font_id == 0 || ats_font_id == 0xFFFFFFFFUL )
       return FT_Err_Unknown_File_Format;
diff --git a/src/base/ftmac.c b/src/base/ftmac.c
index 1347d7d..d696586 100644
--- a/src/base/ftmac.c
+++ b/src/base/ftmac.c
@@ -145,6 +145,7 @@
                                              kCFStringEncodingMacRoman );
     ats_font_id = ATSFontFindFromName( cf_fontName,
                                        kATSOptionFlagsUnRestrictedScope );
+    CFRelease( cf_fontName );
 
     if ( ats_font_id == 0 || ats_font_id == 0xFFFFFFFFUL )
       return FT_Err_Unknown_File_Format;