X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglx%2Fclientinfo.c;h=8f3fdeba4aa1c39ff8f857da2bb7e29b9c0de6a8;hb=714dfaae726534c3791df1ef8a9768f4435166d8;hp=97d43cea0e37c0a75856aa174822ac1f4876423b;hpb=8b5b3b93d73d80a54d12d0d7a6a74fb97b27bf8a;p=mesa.git diff --git a/src/glx/clientinfo.c b/src/glx/clientinfo.c index 97d43cea0e3..8f3fdeba4aa 100644 --- a/src/glx/clientinfo.c +++ b/src/glx/clientinfo.c @@ -39,7 +39,6 @@ __glX_send_client_info(struct glx_display *glx_dpy) Bool any_screen_has_ARB_create_context = False; Bool any_screen_has_ARB_create_context_profile = False; unsigned i; -#ifdef HAVE_XCB_GLX_CREATE_CONTEXT static const uint32_t gl_versions[] = { 1, 4, }; @@ -48,7 +47,6 @@ __glX_send_client_info(struct glx_display *glx_dpy) }; static const char glx_extensions[] = "GLX_ARB_create_context GLX_ARB_create_context_profile"; -#endif /* There are three possible flavors of the client info structure that the * client could send to the server. The version sent depends on the @@ -115,6 +113,10 @@ __glX_send_client_info(struct glx_display *glx_dpy) } gl_extension_string = __glXGetClientGLExtensionString(); + if (gl_extension_string == NULL) { + return; + } + gl_extension_length = strlen(gl_extension_string) + 1; c = XGetXCBConnection(glx_dpy->dpy); @@ -125,7 +127,6 @@ __glX_send_client_info(struct glx_display *glx_dpy) * THE ORDER IS IMPORTANT. We want to send the most recent version of the * protocol that the server can support. */ -#ifdef HAVE_XCB_GLX_CREATE_CONTEXT if (glx_dpy->majorVersion == 1 && glx_dpy->minorVersion == 4 && any_screen_has_ARB_create_context_profile) { xcb_glx_set_client_info_2arb(c, @@ -148,14 +149,12 @@ __glX_send_client_info(struct glx_display *glx_dpy) gl_versions, gl_extension_string, glx_extensions); - } else -#endif - { + } else { xcb_glx_client_info(c, GLX_MAJOR_VERSION, GLX_MINOR_VERSION, gl_extension_length, gl_extension_string); } - Xfree(gl_extension_string); + free(gl_extension_string); }