Mesa (master): mesa: Don't try to free components of a NULL uniform list.

Eric Anholt anholt at kemper.freedesktop.org
Thu Aug 19 00:45:39 UTC 2010


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

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Aug 18 17:42:34 2010 -0700

mesa: Don't try to free components of a NULL uniform list.

This might happen if we manage to trigger the right linker errors.

---

 src/mesa/program/prog_uniform.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/mesa/program/prog_uniform.c b/src/mesa/program/prog_uniform.c
index 5aa9878..28acb88 100644
--- a/src/mesa/program/prog_uniform.c
+++ b/src/mesa/program/prog_uniform.c
@@ -44,6 +44,10 @@ void
 _mesa_free_uniform_list(struct gl_uniform_list *list)
 {
    GLuint i;
+
+   if (!list)
+      return;
+
    for (i = 0; i < list->NumUniforms; i++) {
       free((void *) list->Uniforms[i].Name);
    }




More information about the mesa-commit mailing list