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

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Tue Feb 11 06:07:56 PST 2014


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);
+   }
 }
 
 
-- 
1.8.1.2



More information about the mesa-dev mailing list