From 476de585bee851ea592af043652aa7525bc8d3ce Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 24 Apr 2008 13:29:46 +0930 Subject: [PATCH] dix: NULL out WindowTable after freeing all the windows. CloseDownDevices() tries to send PresenceNotify events. If the windows are already freed, then we are accessing dangling pointers. (cherry picked from commit aec485f2dcc87b340759d67b60e7dee7931aaec5) --- dix/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dix/main.c b/dix/main.c index db4347341..6d9dd3332 100644 --- a/dix/main.c +++ b/dix/main.c @@ -458,7 +458,10 @@ main(int argc, char *argv[], char *envp[]) #endif config_fini(); + + memset(WindowTable, 0, MAXSCREENS * sizeof(WindowPtr)); CloseDownDevices(); + for (i = screenInfo.numScreens - 1; i >= 0; i--) { FreeScratchPixmapsForScreen(i);