Emil Velikov <emil.l.veli...@gmail.com> writes: > On Thu, 15 Nov 2018 at 23:05, Eric Anholt <e...@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.
After driGetDriverExtensions() failure driOpenDriver() NULLs out the handle that gets stored to *out_driver_handle. I did that so that all the callers didn't have to worry about this. (aka asprintf is the worst interface)
signature.asc
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev