diff --git a/src/solaris/native/sun/awt/multiVis.c b/src/solaris/native/sun/awt/multiVis.c index 258ea5b2aff5f7ee0aae32ee5f2d646233b5aae1..539e2921108219825832a35efa985e429ba5cebc 100644 --- a/src/solaris/native/sun/awt/multiVis.c +++ b/src/solaris/native/sun/awt/multiVis.c @@ -218,7 +218,11 @@ QueryColorMap(Display *disp, Colormap src_cmap, Visual *src_vis, XColor *colors ; ncolors = (unsigned) src_vis->map_entries ; - *src_colors = colors = (XColor *)malloc(ncolors * sizeof(XColor) ) ; +/* JDK modification. + * use calloc instead of malloc to initialize allocated memory + * *src_colors = colors = (XColor *)malloc(ncolors * sizeof(XColor) ) ; + */ + *src_colors = colors = (XColor *)calloc(ncolors, sizeof(XColor)); if(src_vis->class != TrueColor && src_vis->class != DirectColor) {