[Mesa-dev] [PATCH 2/5] glx: Move DRI extensions pointer loading to driOpenDriver().

Emil Velikov emil.l.velikov at gmail.com
Fri Nov 16 17:29:58 UTC 2018


On Thu, 15 Nov 2018 at 23:05, Eric Anholt <eric at anholt.net> wrote:

> --- a/src/glx/dri_glx.c
> +++ b/src/glx/dri_glx.c
> @@ -199,15 +199,9 @@ clear_driver_config_cache()
>  static char *
>  get_driver_config(const char *driverName)
>  {
> -   void *handle = driOpenDriver(driverName);
> -   const __DRIextension **extensions;
> -
> -   if (!handle)
> -      return NULL;
> -
> +   void *handle;
I think we want to initialise this variable.

Otherwise on failure when driGetDriverExtensions() fails, we'll feed
garbage into dlclose() further down.
It's unlikely that will happen, but If nothing else the static
analysis tools will be happy.

With this and Eric's suggestion in 5/5 the series is:
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

-Emil


More information about the mesa-dev mailing list