changeset 1904:e1cd8b6d8e3c

6893704: Potential memory leak in gtk2_interface.c Reviewed-by: stayer
author peterz
date Thu, 22 Oct 2009 15:43:25 +0400
parents 050ee24054c8
children c06c491eff67
files src/solaris/native/sun/awt/gtk2_interface.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/sun/awt/gtk2_interface.c	Wed Oct 21 14:25:25 2009 +0400
+++ b/src/solaris/native/sun/awt/gtk2_interface.c	Thu Oct 22 15:43:25 2009 +0400
@@ -637,13 +637,13 @@
     if (gtk_modules_env && strstr (gtk_modules_env, "atk-bridge") ||
         gtk_modules_env && strstr (gtk_modules_env, "gail"))
     {
-        gchar *tmp_env = strdup (gtk_modules_env);
         /* the new env will be smaller than the old one */
         gchar *s, *new_env = malloc (sizeof(ENV_PREFIX)+strlen (gtk_modules_env));
 
         if (new_env != NULL )
         {
             /* careful, strtok modifies its args */
+            gchar *tmp_env = strdup (gtk_modules_env);
             strcpy(new_env, ENV_PREFIX);
 
             /* strip out 'atk-bridge' and 'gail' */