[Mesa-dev] [PATCH v2] linker: Fix memory leak in count_uniform_size::visit_field.
Kenneth Graunke
kenneth at whitecape.org
Fri Mar 30 23:55:40 PDT 2012
On 03/30/2012 11:48 PM, Vinson Lee wrote:
> Fixes a Coverity resource leak defect.
>
> NOTE: This is a candidate for the 8.0 branch.
>
> Signed-off-by: Vinson Lee<vlee at freedesktop.org>
> ---
> src/glsl/link_uniforms.cpp | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp
> index 613c9b7..2f1c9f5 100644
> --- a/src/glsl/link_uniforms.cpp
> +++ b/src/glsl/link_uniforms.cpp
> @@ -173,8 +173,7 @@ private:
> if (this->map->get(id, name))
> return;
>
> - char *key = strdup(name);
> - this->map->put(this->num_active_uniforms, key);
> + this->map->put(this->num_active_uniforms, name);
>
> /* Each leaf uniform occupies one entry in the list of active
> * uniforms.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
More information about the mesa-dev
mailing list