[Mesa-stable] [PATCH] glx: Properly handle cases where screen creation fails
Emil Velikov
emil.l.velikov at gmail.com
Wed Feb 21 21:15:35 UTC 2018
On 21 February 2018 at 15:10, Chuck Atkins <chuck.atkins at kitware.com> wrote:
>> Something doesn't look quite right - it seems that xmesa_init_display
>> should be fixed instead.
>>
>> Currently it returns non-NULL when either of the following fail:
>> - driver.create_pipe_screen()
>> - CALLOC_STRUCT
>>
>> I would add an explicit check after those + goto err_path.
>> The latter of which doing some proper teardown. Note: that there's a
>> leak in there - one should walk, detach & free the new entry from the
>> MesaExtInfo list.
>
>
> Rather than deal with the list cleanup after the fact, I can postpone the
> list insertion until the end when info is in a known good state. That way
> when the error conditions are hit, the only cleanup that needs to be done is
> localized to screen and smapi.
>
That will also work - the DRI based GLX does it already. For details
see the __glXInitialize in src/glx/glxext.c.
HTH
Emil
More information about the mesa-stable
mailing list