summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/add_window.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/add_window.c b/src/add_window.c
index 8cf23c5..72aa0aa 100644
--- a/src/add_window.c
+++ b/src/add_window.c
@@ -1535,10 +1535,12 @@ FetchWmColormapWindows (TwmWindow *tmp)
cwins = (ColormapWindow **) malloc(sizeof(ColormapWindow *));
if (XFindContext(dpy, tmp->w, ColormapContext, (caddr_t *)&cwins[0]) ==
- XCNOENT)
+ XCNOENT) {
cwins[0] = CreateColormapWindow(tmp->w,
(Bool) tmp->cmaps.number_cwins == 0, False);
- else
+ if (cwins[0] == NULL)
+ number_cmap_windows = 0;
+ } else
cwins[0]->refcnt++;
}