summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-12-14 11:16:10 +0200
committerEli Zaretskii <eliz@gnu.org>2013-12-14 11:16:10 +0200
commit95c216526e3700d46319d8fb47844a5e07662bbf (patch)
treee71678149f7461657b1ee4a483a83692bb2aafc0 /src/alloc.c
parent0b32070bbd13c8f19be93185172e985213972d7b (diff)
downloademacs-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.c7
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. */