[Mesa-stable] [PATCH] glx: Properly handle cases where screen creation fails

Chuck Atkins chuck.atkins at kitware.com
Wed Feb 21 15:10:33 UTC 2018


>
> 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.

- Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-stable/attachments/20180221/9b113905/attachment.html>


More information about the mesa-stable mailing list