[Mesa-dev] [PATCH 1/5] glx: Add extra null check in __glXClientInfo

Ian Romanick idr at freedesktop.org
Mon Feb 17 12:24:43 PST 2014


It looks like this function has been unused since commit 3f0e3a7, so we
should just delete the whole thing.

On 02/14/2014 05:23 AM, Juha-Pekka Heikkila wrote:
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
> ---
>  src/glx/glxcmds.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
> index 38a5262..4d8d0c2 100644
> --- a/src/glx/glxcmds.c
> +++ b/src/glx/glxcmds.c
> @@ -1392,13 +1392,16 @@ void
>  __glXClientInfo(Display * dpy, int opcode)
>  {
>     char *ext_str = __glXGetClientGLExtensionString();
> -   int size = strlen(ext_str) + 1;
>  
> -   xcb_connection_t *c = XGetXCBConnection(dpy);
> -   xcb_glx_client_info(c,
> -                       GLX_MAJOR_VERSION, GLX_MINOR_VERSION, size, ext_str);
> +   if (ext_str) {
> +      int size = strlen(ext_str) + 1;
>  
> -   free(ext_str);
> +      xcb_connection_t *c = XGetXCBConnection(dpy);
> +      xcb_glx_client_info(c, GLX_MAJOR_VERSION, GLX_MINOR_VERSION, size,
> +                          ext_str);
> +
> +      free(ext_str);
> +   }
>  }
>  
>  
> 



More information about the mesa-dev mailing list