xlib: use XMesaDestroyVisual instead of manual free

Replace it with XMesaDestroyVisual() to properly handle deallocation.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14947
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40422>
This commit is contained in:
Mixie 2026-03-14 21:29:00 +03:00 committed by Marge Bot
parent 8131af3f77
commit 61d1e8fc85

View file

@ -874,8 +874,7 @@ XMesaVisual XMesaCreateVisual( Display *display,
v->stvis.color_format = PIPE_FORMAT_NONE;
if (v->stvis.color_format == PIPE_FORMAT_NONE) {
free(v->visinfo);
free(v);
XMesaDestroyVisual(v);
return NULL;
}