glx: Add missing null check in __glXCloseDisplay
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Fri, 7 Feb 2014 12:43:58 +0000 (14:43 +0200)
committerBrian Paul <brianp@vmware.com>
Fri, 7 Feb 2014 15:14:04 +0000 (08:14 -0700)
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/glx/glxext.c

index 2711e57b793016a4d0c1ffffd04207c33a5abc8a..4a195bd40ba272da5125d22a037e52826b434e37 100644 (file)
@@ -269,7 +269,8 @@ __glXCloseDisplay(Display * dpy, XExtCodes * codes)
    }
    _XUnlockMutex(_Xglobal_lock);
 
-   glx_display_free(priv);
+   if (priv != NULL)
+      glx_display_free(priv);
 
    return 1;
 }