Re: [Mesa-dev] [PATCH] egl_dri2: check if driver_name is NULL before releasing it

2018-10-30 Thread Erik Faye-Lund
On Tue, 2018-10-30 at 18:28 +0800, Zhaowei YUan wrote: > I don't think it's fine, usually, freeing an NULL pointer will cause > unexpected errors. It's better to check this for the robustness. > From http://pubs.opengroup.org/onlinepubs/009695399/functions/free.html : "If ptr is a null

Re: [Mesa-dev] [PATCH] egl_dri2: check if driver_name is NULL before releasing it

2018-10-30 Thread Zhaowei YUan
I don't think it's fine, usually, freeing an NULL pointer will cause unexpected errors. It's better to check this for the robustness. On 10/30/18 3:17 PM, Tapani Pälli wrote: > On 10/30/18 8:26 AM, Zhaowei Yuan wrote: >> Pointer dri2_dpy->driver_name is probably NULL when calling >>

Re: [Mesa-dev] [PATCH] egl_dri2: check if driver_name is NULL before releasing it

2018-10-30 Thread Tapani Pälli
On 10/30/18 8:26 AM, Zhaowei Yuan wrote: Pointer dri2_dpy->driver_name is probably NULL when calling dri2_display_destory, check this before releasing it. It's fine for it to be NULL though and it looks like all the drivers set it correctly, there is no need for such check. Does this change

[Mesa-dev] [PATCH] egl_dri2: check if driver_name is NULL before releasing it

2018-10-30 Thread Zhaowei Yuan
Pointer dri2_dpy->driver_name is probably NULL when calling dri2_display_destory, check this before releasing it. Signed-off-by: Zhaowei Yuan --- src/egl/drivers/dri2/egl_dri2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/egl/drivers/dri2/egl_dri2.c