changeset 1757:e05b23750b9b

6893704: Potential memory leak in gtk2_interface.c Reviewed-by: stayer
author peterz
date Thu, 22 Oct 2009 15:43:25 +0400
parents fa95260136c1
children 2f33be2c6b6a
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 Aug 07 18:32:03 2013 +0400
+++ b/src/solaris/native/sun/awt/gtk2_interface.c	Thu Oct 22 15:43:25 2009 +0400
@@ -636,7 +636,6 @@
     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 = SAFE_SIZE_STRUCT_ALLOC(malloc,
                 sizeof(ENV_PREFIX), 1, strlen (gtk_modules_env));
@@ -644,6 +643,7 @@
         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' */