From 10d2805dbc6b96a159b8c5acedcd53f34df362bf Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 26 Jun 2014 14:12:24 -0700 Subject: fb: Don't free NULL pixmap in fbCloseScreen. Bug #80313 We fixed fbCloseScreen to use the FreePixmap function so that the private counts would be updated correctly during CloseScreen. Xvfb calls FreePixmap and sets devPrivate to NULL before fbCloseScreen is called; not checking devPrivate before calling would result in a NULL pointer dereference. Signed-off-by: Keith Packard Reviewed-by: Julien Cristau --- fb/fbscreen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fb/fbscreen.c') diff --git a/fb/fbscreen.c b/fb/fbscreen.c index 1f9108945..0d4d87f8b 100644 --- a/fb/fbscreen.c +++ b/fb/fbscreen.c @@ -37,7 +37,8 @@ fbCloseScreen(ScreenPtr pScreen) free(depths[d].vids); free(depths); free(pScreen->visuals); - FreePixmap((PixmapPtr)pScreen->devPrivate); + if (pScreen->devPrivate) + FreePixmap((PixmapPtr)pScreen->devPrivate); return TRUE; } -- cgit v1.2.3