glx: Move dereference and initialization to after NULL check.
authorVinson Lee <vlee@vmware.com>
Thu, 15 Jul 2010 07:20:41 +0000 (00:20 -0700)
committerVinson Lee <vlee@vmware.com>
Thu, 15 Jul 2010 07:20:41 +0000 (00:20 -0700)
src/glx/glx_pbuffer.c

index c081836376dc57bc5e4c3c97bb01482ca5e692de..f6f931df7d2d38d6eed05d1eca8894c76874f91a 100644 (file)
@@ -86,7 +86,7 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
                         const CARD32 * attribs, size_t num_attribs)
 {
    __GLXdisplayPrivate *priv = __glXInitialize(dpy);
-   __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL);
+   __GLXDRIdrawable *pdraw;
    CARD32 *output;
    CARD8 opcode;
    int i;
@@ -95,6 +95,8 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
       return;
    }
 
+   pdraw = GetGLXDRIDrawable(dpy, drawable, NULL);
+
    opcode = __glXSetupForCommand(dpy);
    if (!opcode)
       return;