From 94a4eb1e7806bfcb52f6cd48f8071238da7e2cf8 Mon Sep 17 00:00:00 2001 From: Vladimir Dergachev Date: Sat, 6 Aug 2005 05:19:42 +0000 Subject: [PATCH] Follow suggestion by Aapo Tahkola to fix giant memory leak from forgetting to free the key when entry was already found (presumably a common case). --- src/mesa/main/texenvprogram.c | 1 + src/mesa/tnl/t_vp_build.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index f18ae041f3c..4cb97469a58 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -1145,6 +1145,7 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx ) cache_item(&ctx->Texture.env_fp_cache, hash, key, ctx->_TexEnvProgram); } else { + FREE(key); if (0) _mesa_printf("Found existing texenv program for key %x\n", hash); } diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c index 049bd20bd9d..e62c5b374c2 100644 --- a/src/mesa/tnl/t_vp_build.c +++ b/src/mesa/tnl/t_vp_build.c @@ -1473,6 +1473,7 @@ void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx ) cache_item(&tnl->vp_cache, hash, key, ctx->_TnlProgram ); } else { + FREE(key); if (0) _mesa_printf("Found existing TNL program for key %x\n", hash); } -- 2.30.2