From: Eli Zaretskii Date: Sat, 14 Dec 2013 09:16:10 +0000 (+0200) Subject: Avoid crashing due to closing of font whose driver pointer is NULL. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~419 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=95c216526e3700d46319d8fb47844a5e07662bbf;p=emacs.git Avoid crashing due to closing of font whose driver pointer is NULL. src/alloc.c (cleanup_vector): Don't call the font driver's 'close' method if the 'driver' pointer is NULL. --- diff --git a/src/ChangeLog b/src/ChangeLog index df145600556..a9672768b48 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2013-12-14 Eli Zaretskii + * alloc.c (cleanup_vector): Don't call the font driver's 'close' + method if the 'driver' pointer is NULL. + * fileio.c (Fcopy_file) [WINDOWSNT]: Move most of the Windows-specific code to w32.c. Change error message text to match that of Posix platforms. diff --git a/src/alloc.c b/src/alloc.c index aeda42637cd..1cf0f3cc1d2 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -2877,7 +2877,12 @@ cleanup_vector (struct Lisp_Vector *vector) if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_FONT) && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK) == FONT_OBJECT_MAX)) - ((struct font *) vector)->driver->close ((struct font *) vector); + { + struct font *fnt = (struct font *) vector; + + if (fnt->driver) + fnt->driver->close ((struct font *) vector); + } } /* Reclaim space used by unmarked vectors. */