glx: Prevent potential null pointer deference in driCreateContext.
authorVinson Lee <vlee@vmware.com>
Mon, 23 Nov 2009 06:30:32 +0000 (01:30 -0500)
committerVinson Lee <vlee@vmware.com>
Sun, 6 Dec 2009 08:56:20 +0000 (00:56 -0800)
(cherry picked from commit 4b0b250aae6ae7d48cd24f9d91d05ab58086c4b2)

src/glx/x11/drisw_glx.c

index 15e15866582c18f84b6db0b07ddaa84d25df1d61..1866b2cc870b5f5bd25914c62b6c1f07a5f8ec9d 100644 (file)
@@ -250,12 +250,14 @@ driCreateContext(__GLXscreenConfigs * psc,
 {
    __GLXDRIcontextPrivate *pcp, *pcp_shared;
    __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode;
-   const __DRIcoreExtension *core = psc->core;
+   const __DRIcoreExtension *core;
    __DRIcontext *shared = NULL;
 
    if (!psc || !psc->driScreen)
       return NULL;
 
+   core = psc->core;
+
    if (shareList) {
       pcp_shared = (__GLXDRIcontextPrivate *) shareList->driContext;
       shared = pcp_shared->driContext;