6893704: Potential memory leak in gtk2_interface.c
authorpeterz
Thu, 22 Oct 2009 15:43:25 +0400
changeset 4270 cfaee5c87755
parent 4269 0283fbab043c
child 4271 35fc7add4925
6893704: Potential memory leak in gtk2_interface.c Reviewed-by: stayer
jdk/src/solaris/native/sun/awt/gtk2_interface.c
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Wed Oct 21 14:25:25 2009 +0400
+++ b/jdk/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' */