Mesa (master): glx: Move dereference and initialization to after NULL check .

Vinson Lee vlee at kemper.freedesktop.org
Thu Jul 15 07:21:35 UTC 2010


Module: Mesa
Branch: master
Commit: 5c9e54f2ff2eb651b5bf594ac95d39ba5747c500
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5c9e54f2ff2eb651b5bf594ac95d39ba5747c500

Author: Vinson Lee <vlee at vmware.com>
Date:   Thu Jul 15 00:20:41 2010 -0700

glx: Move dereference and initialization to after NULL check.

---

 src/glx/glx_pbuffer.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c
index c081836..f6f931d 100644
--- a/src/glx/glx_pbuffer.c
+++ b/src/glx/glx_pbuffer.c
@@ -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;




More information about the mesa-commit mailing list