fix mem leak
[mesa.git] / src / mesa / main / colortab.c
index e9349516eb86531674dcbc4908920bb719a4afec..9fb0baf4a7c3e624148b189e268f503708f84195 100644 (file)
@@ -472,8 +472,8 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
       _mesa_free_colortable_data(table);
 
       if (width > 0) {
-         table->TableF = _mesa_malloc(comps * width * sizeof(GLfloat));
-         table->TableUB = _mesa_malloc(comps * width * sizeof(GLubyte));
+         table->TableF = (GLfloat *) _mesa_malloc(comps * width * sizeof(GLfloat));
+         table->TableUB = (GLubyte *) _mesa_malloc(comps * width * sizeof(GLubyte));
 
         if (!table->TableF || !table->TableUB) {
            _mesa_error(ctx, GL_OUT_OF_MEMORY, "glColorTable");