changeset 100427:e0aa0e328261

(xftfont_open): Free Xft font pattern if XftFontOpenPattern fails.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 15 Dec 2008 01:57:40 +0000
parents 0e8afcdd9ee4
children f0702db6689a
files src/xftfont.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/xftfont.c	Mon Dec 15 01:57:19 2008 +0000
+++ b/src/xftfont.c	Mon Dec 15 01:57:40 2008 +0000
@@ -279,7 +279,10 @@
   UNBLOCK_INPUT;
 
   if (! xftfont)
-    return Qnil;
+    {
+      XftPatternDestroy (match);
+      return Qnil;
+    }
   /* We should not destroy PAT here because it is kept in XFTFONT and
      destroyed automatically when XFTFONT is closed.  */
   font_object = font_make_object (VECSIZE (struct xftfont_info), entity, size);