The XMesaVisual instances freed in the visuals table on display close
are being freed with a free() call, instead of XMesaDestroyVisual(),
causing a memory leak.
Signed-off-by: John Sheu <sheu@google.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
if (VisualTable[i]->display == dpy) {
/* remove this visual */
int j;
- free(VisualTable[i]);
+ XMesaDestroyVisual(VisualTable[i]);
for (j = i; j < NumVisuals - 1; j++)
VisualTable[j] = VisualTable[j + 1];
NumVisuals--;
accum_red_size, accum_green_size,
accum_blue_size, accum_alpha_size,
0)) {
+ free(v->visinfo);
free(v);
return NULL;
}