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 <keithp@keithp.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
This commit is contained in:
Keith Packard 2014-06-26 14:12:24 -07:00
parent a3b44ad8db
commit 10d2805dbc
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}