changeset 4799:ca99a807b025

Free, rather than discard, the return value of FcNameUnparse. See message <870180fe1001051404g11355acdp3ee9aab8b1ffb33b@mail.gmail.com> on xemacs-patches.
author Jerry James <james@xemacs.org>
date Tue, 05 Jan 2010 15:06:02 -0700
parents ea7a6c12df45
children 591091481f20
files src/ChangeLog src/font-mgr.c
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Jan 04 16:48:55 2010 -0700
+++ b/src/ChangeLog	Tue Jan 05 15:06:02 2010 -0700
@@ -1,3 +1,8 @@
+2010-01-05  Jerry James  <james@xemacs.org>
+
+	* font-mgr.c (Ffc_name_unparse): Return value of FcNameUnparse
+	must be freed.
+
 2009-12-31  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* eval.c (Ffunctionp): 
--- a/src/font-mgr.c	Mon Jan 04 16:48:55 2010 -0700
+++ b/src/font-mgr.c	Tue Jan 05 15:06:02 2010 -0700
@@ -260,8 +260,13 @@
 */
       (pattern))
 {
+  FcChar8 *name;
+  Lisp_Object result;
   CHECK_FCPATTERN(pattern);
-  return build_fcapi_string (FcNameUnparse (XFCPATTERN_PTR (pattern)));
+  name = FcNameUnparse (XFCPATTERN_PTR (pattern));
+  result = build_fcapi_string (name);
+  xfree (name, FcChar8 *);
+  return result;
 }
 
 DEFUN("fc-pattern-duplicate", Ffc_pattern_duplicate, 1, 1, 0, /*