summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2014-02-13 09:49:27 -0800
committerCarl Worth <cworth@cworth.org>2014-03-04 13:20:01 -0800
commit5202312160347dab4c8514859ff5c2f9a7bfad79 (patch)
tree126b240fa163e604b5ac61a6cfd193a7817c5cd0
parentd6e83e9a7ab1e1d27a90277fe30ca1cb22baa1bc (diff)
main: Avoid double-free of shader Label
As documented, the _mesa_free_shader_program_data function: "Frees all the data that hangs off a shader program object, but not the object itself." This means that this function may be called multiple times on the same object, (and has been observed to). Meanwhile, the shProg->Label field was not being set to NULL after its free(). This led to a second call to free() of the same address on the second call to this function. Fix this by setting this field to NULL after free(), (just as with all other calls to free() in this function). Reviewed-by: Brian Paul <brianp@vmware.com> CC: mesa-stable@lists.freedesktop.org (cherry picked from commit a92581acf2aba5e5e9fa199b778e649d5741754d)
-rw-r--r--src/mesa/main/shaderobj.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 0d794ad9693..97f66450bba 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -354,6 +354,7 @@ _mesa_free_shader_program_data(struct gl_context *ctx,
}
free(shProg->Label);
+ shProg->Label = NULL;
}