changeset 4270:cfaee5c87755

6893704: Potential memory leak in gtk2_interface.c Reviewed-by: stayer
author peterz
date Thu, 22 Oct 2009 15:43:25 +0400
parents 0283fbab043c
children 35fc7add4925
files jdk/src/solaris/native/sun/awt/gtk2_interface.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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' */