From: Chong Yidong Date: Tue, 30 Jun 2009 22:08:57 +0000 (+0000) Subject: * xftfont.c (xftfont_open): Avoid passing NULL argument to X-Git-Tag: emacs-pretest-23.0.96~58 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f3c91297202e7bd14b317a41bd9c1b79f15dd939;p=emacs.git * xftfont.c (xftfont_open): Avoid passing NULL argument to XftLockFace. --- diff --git a/src/ChangeLog b/src/ChangeLog index 180b7937770..d247401d3f3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-06-30 Chong Yidong + + * xftfont.c (xftfont_open): Avoid passing NULL argument to + XftLockFace. + 2009-06-28 David Reitter * nsterm.m (keydown): Avoid infinite loop. diff --git a/src/xftfont.c b/src/xftfont.c index 4a1b488bcf9..8a12b2f24cb 100644 --- a/src/xftfont.c +++ b/src/xftfont.c @@ -287,14 +287,15 @@ xftfont_open (f, entity, pixel_size) match = XftFontMatch (display, FRAME_X_SCREEN_NUMBER (f), pat, &result); FcPatternDestroy (pat); xftfont = XftFontOpenPattern (display, match); - ft_face = XftLockFace (xftfont); - UNBLOCK_INPUT; - if (! xftfont) { + UNBLOCK_INPUT; XftPatternDestroy (match); return Qnil; } + ft_face = XftLockFace (xftfont); + UNBLOCK_INPUT; + /* 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);