Mesa (master): mesa: move null ptr check (fdo bug 29843)

Brian Paul brianp at kemper.freedesktop.org
Fri Aug 27 13:35:58 PDT 2010


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

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Aug 27 14:35:52 2010 -0600

mesa: move null ptr check (fdo bug 29843)

---

 src/mesa/main/shaderobj.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 65d8d11..59198d7 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -104,9 +104,9 @@ _mesa_new_shader(GLcontext *ctx, GLuint name, GLenum type)
    assert(type == GL_FRAGMENT_SHADER || type == GL_VERTEX_SHADER ||
           type == GL_GEOMETRY_SHADER_ARB);
    shader = talloc_zero(NULL, struct gl_shader);
-   shader->Type = type;
-   shader->Name = name;
    if (shader) {
+      shader->Type = type;
+      shader->Name = name;
       _mesa_init_shader(ctx, shader);
    }
    return shader;



More information about the mesa-commit mailing list