Check if visualList == NULL, not nVisualsMatched == 0. NULL happens in more

cases (allocation failure) than nVisualsMatched == 0.  Noticed from inspection
of Coverity #599, #600.
This commit is contained in:
Eric Anholt 2006-04-05 17:12:15 -07:00 committed by Jamey Sharp
parent 8b42635f57
commit 5262a1945c

View file

@ -146,7 +146,7 @@ CmapRecForColormap(
visualTemplate.screen = i;
visualList = XGetVisualInfo(dpy, VisualScreenMask, &visualTemplate,
&nVisualsMatched);
if (nVisualsMatched == 0) {
if (visualList == NULL) {
continue;
}