mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
xlib: fix memory leak on Display close
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>
This commit is contained in:
parent
d04bb14d04
commit
7f08547248
2 changed files with 2 additions and 1 deletions
|
|
@ -794,7 +794,7 @@ destroy_visuals_on_display(Display *dpy)
|
|||
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--;
|
||||
|
|
|
|||
|
|
@ -856,6 +856,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
|
|||
accum_red_size, accum_green_size,
|
||||
accum_blue_size, accum_alpha_size,
|
||||
0)) {
|
||||
free(v->visinfo);
|
||||
free(v);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue