From 5c629bf654b2d1c137f1e503b9a58cd75af9199b Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 15 Dec 2008 01:57:40 +0000 Subject: [PATCH] (xftfont_open): Free Xft font pattern if XftFontOpenPattern fails. --- src/xftfont.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xftfont.c b/src/xftfont.c index 8eadd060765..21c17a06aa2 100644 --- a/src/xftfont.c +++ b/src/xftfont.c @@ -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); -- 2.39.2