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
This commit is contained in:
Carl Worth 2014-02-13 09:49:27 -08:00
parent e4a5a9fd2f
commit a92581acf2
1 changed files with 1 additions and 0 deletions

View File

@ -355,6 +355,7 @@ _mesa_free_shader_program_data(struct gl_context *ctx,
}
free(shProg->Label);
shProg->Label = NULL;
}