(xftfont_open): Free Xft font pattern if XftFontOpenPattern fails.
authorChong Yidong <cyd@stupidchicken.com>
Mon, 15 Dec 2008 01:57:40 +0000 (01:57 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Mon, 15 Dec 2008 01:57:40 +0000 (01:57 +0000)
src/xftfont.c

index 8eadd06..21c17a0 100644 (file)
@@ -279,7 +279,10 @@ xftfont_open (f, entity, pixel_size)
   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);