summaryrefslogtreecommitdiff
path: root/fb/fbscreen.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-06-26 14:12:24 -0700
committerKeith Packard <keithp@keithp.com>2014-07-03 12:57:19 -0700
commit10d2805dbc6b96a159b8c5acedcd53f34df362bf (patch)
tree714555e1781bd8df516de7835e4e27730018f8d6 /fb/fbscreen.c
parenta3b44ad8db1fa2f3b81c1ff9498f31c5323edd37 (diff)
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>
Diffstat (limited to 'fb/fbscreen.c')
-rw-r--r--fb/fbscreen.c3
1 files changed, 2 insertions, 1 deletions
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;
}