glx: add a missing nullptr check

This caused GLX applications to segfault under zink.
This technically also fixes cleanup when any driver fails init

Signed-off-by: Sid Pranjale <mail@sidonthe.net>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31072>
This commit is contained in:
Sid Pranjale 2024-09-07 10:34:11 +05:30 committed by Marge Bot
parent c20552678a
commit 27c09eacb7

View file

@ -739,7 +739,10 @@ glx_screen_cleanup(struct glx_screen *psc)
psc->visuals = NULL; /* NOTE: just for paranoia */
}
#if defined(GLX_DIRECT_RENDERING) && (!defined(GLX_USE_APPLEGL) || defined(GLX_USE_APPLE))
driDestroyConfigs(psc->driver_configs);
if (psc->driver_configs) {
driDestroyConfigs(psc->driver_configs);
psc->driver_configs = NULL;
}
/* Free the direct rendering per screen data */
driDestroyScreen(psc->frontend_screen);
#endif