From 89193933cbd322cd08fb54232411a8a9221fcca8 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 28 Jul 2011 15:10:17 -0700 Subject: mesa: Ensure that gl_shader_program::InfoLog is never NULL This prevents assertion failures in ralloc_strcat. The ralloc_free in _mesa_free_shader_program_data can be omitted because freeing the gl_shader_program in _mesa_delete_shader_program will take care of this automatically. A bunch of this code could use a refactor to use ralloc a bit more effectively. A bunch of the things that are allocated with malloc and owned by the gl_shader_program should be allocated with ralloc (using the gl_shader_program as the context). Signed-off-by: Ian Romanick Reviewed-by: Kenneth Graunke Reviewed-by: Eric Anholt --- src/glsl/main.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/glsl') diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp index 9f85096e1a1..9b8a50738ac 100644 --- a/src/glsl/main.cpp +++ b/src/glsl/main.cpp @@ -221,6 +221,7 @@ main(int argc, char **argv) whole_program = rzalloc (NULL, struct gl_shader_program); assert(whole_program != NULL); + whole_program->InfoLog = ralloc_strdup(whole_program, ""); for (/* empty */; argc > optind; optind++) { whole_program->Shaders = -- cgit v1.2.3