Mesa (glsl2): glsl2: Use talloc on InfoLog handling in ValidateProgram

Eric Anholt anholt at kemper.freedesktop.org
Thu Jul 22 20:13:58 UTC 2010


Module: Mesa
Branch: glsl2
Commit: 7095e2f860b91288c89c57add438e912e10df38e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7095e2f860b91288c89c57add438e912e10df38e

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Jul 21 23:21:23 2010 -0700

glsl2: Use talloc on InfoLog handling in ValidateProgram

Fixes a segfault in Regnum Online.

---

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

diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index cd02d7d..1c16653 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -1380,9 +1380,9 @@ _mesa_validate_program(GLcontext *ctx, GLuint program)
    if (!shProg->Validated) {
       /* update info log */
       if (shProg->InfoLog) {
-         free(shProg->InfoLog);
+         talloc_free(shProg->InfoLog);
       }
-      shProg->InfoLog = _mesa_strdup(errMsg);
+      shProg->InfoLog = talloc_strdup(shProg, errMsg);
    }
 }
 




More information about the mesa-commit mailing list