# HG changeset patch # User Chong Yidong # Date 1246399664 0 # Node ID e561e9f73ad42aeb975a8393d21706b427b9b9f6 # Parent 9cfbe8bebc89c8f50586cc561f1403bffc620f0d * xftfont.c (xftfont_open): Avoid passing NULL argument to XftLockFace. diff -r 9cfbe8bebc89 -r e561e9f73ad4 src/ChangeLog --- a/src/ChangeLog Tue Jun 30 21:29:44 2009 +0000 +++ b/src/ChangeLog Tue Jun 30 22:07:44 2009 +0000 @@ -1,3 +1,8 @@ +2009-06-30 Chong Yidong + + * xftfont.c (xftfont_open): Avoid passing NULL argument to + XftLockFace. + 2009-06-30 Jason Rumney * w32term.c (w32_initialize): Use GetModuleHandle for library that diff -r 9cfbe8bebc89 -r e561e9f73ad4 src/xftfont.c --- a/src/xftfont.c Tue Jun 30 21:29:44 2009 +0000 +++ b/src/xftfont.c Tue Jun 30 22:07:44 2009 +0000 @@ -287,14 +287,15 @@ match = XftFontMatch (display, FRAME_X_SCREEN_NUMBER (f), pat, &result); FcPatternDestroy (pat); xftfont = XftFontOpenPattern (display, match); + if (!xftfont) + { + UNBLOCK_INPUT; + XftPatternDestroy (match); + return Qnil; + } ft_face = XftLockFace (xftfont); UNBLOCK_INPUT; - if (! xftfont) - { - 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);