[Mesa-dev] [PATCH] main: Fix memory leak in _mesa_make_extension_string()

Chad Versace chad.versace at linux.intel.com
Mon Apr 9 14:23:22 PDT 2012


I forgot to free the string returned by strdup().

Note: This is a candidate for the stable branches.
CC: Johannes Obermayr <johannesobermayr at gmx.de>
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 src/mesa/main/extensions.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 8c262af..3ce4cd5 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -750,6 +750,8 @@ get_extension_override( struct gl_context *ctx )
       }
    }
 
+   free(env);
+
    /* Remove trailing space. */
    len = strlen(extra_exts);
    if (extra_exts[len - 1] == ' ')
-- 
1.7.7.6



More information about the mesa-dev mailing list