diff options
author | Eli Zaretskii <eliz@gnu.org> | 2013-12-14 11:16:10 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2013-12-14 11:16:10 +0200 |
commit | 95c216526e3700d46319d8fb47844a5e07662bbf (patch) | |
tree | e71678149f7461657b1ee4a483a83692bb2aafc0 /src/alloc.c | |
parent | 0b32070bbd13c8f19be93185172e985213972d7b (diff) | |
download | emacs-95c216526e3700d46319d8fb47844a5e07662bbf.tar.gz |
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.
Diffstat (limited to 'src/alloc.c')
-rw-r--r-- | src/alloc.c | 7 |
1 files changed, 6 insertions, 1 deletions
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. */ |