aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorEli Zaretskii2013-12-14 11:16:10 +0200
committerEli Zaretskii2013-12-14 11:16:10 +0200
commit95c216526e3700d46319d8fb47844a5e07662bbf (patch)
treee71678149f7461657b1ee4a483a83692bb2aafc0 /src/alloc.c
parent0b32070bbd13c8f19be93185172e985213972d7b (diff)
downloademacs-95c216526e3700d46319d8fb47844a5e07662bbf.tar.gz
emacs-95c216526e3700d46319d8fb47844a5e07662bbf.zip
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)
2877 if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_FONT) 2877 if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_FONT)
2878 && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK) 2878 && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK)
2879 == FONT_OBJECT_MAX)) 2879 == FONT_OBJECT_MAX))
2880 ((struct font *) vector)->driver->close ((struct font *) vector); 2880 {
2881 struct font *fnt = (struct font *) vector;
2882
2883 if (fnt->driver)
2884 fnt->driver->close ((struct font *) vector);
2885 }
2881} 2886}
2882 2887
2883/* Reclaim space used by unmarked vectors. */ 2888/* Reclaim space used by unmarked vectors. */