diff -wcr gimp-1.2.4-pre1/plug-ins/script-fu/script-fu-server.c gimp-1.2.4-pre1-ft/plug-ins/script-fu/script-fu-server.c
*** gimp-1.2.4-pre1/plug-ins/script-fu/script-fu-server.c	Fri Nov  9 11:15:16 2001
--- gimp-1.2.4-pre1-ft/plug-ins/script-fu/script-fu-server.c	Mon Jun 24 02:08:55 2002
***************
*** 517,522 ****
--- 649,656 ----
    va_end (args);
  
    fputs (buf, server_log_file);
+ //cameron
+   g_free(buf);
    if (server_log_file != stdout)
      fflush (server_log_file);
  }
diff -wcr gimp-1.2.4-pre1/plug-ins/script-fu/script-fu.c gimp-1.2.4-pre1-ft/plug-ins/script-fu/script-fu.c
*** gimp-1.2.4-pre1/plug-ins/script-fu/script-fu.c	Mon Apr  9 01:52:38 2001
--- gimp-1.2.4-pre1-ft/plug-ins/script-fu/script-fu.c	Thu Jun 27 13:00:51 2002
***************
*** 15,20 ****
--- 15,24 ----
   * along with this program; if not, write to the Free Software
   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   */
+ /*
+  * Thu Jun 27 13:00:22 EST 2002 - Cameron, http://www.flamingtext.com/
+  *	Cleaned up some (leaking) memory problems.
+  */
  
  #include "config.h"
  
***************
*** 546,551 ****
--- 550,562 ----
  				      &params, &return_vals))
      return my_err ("Invalid procedure name specified.", NIL);
  
+   /** free the unused stuff straight away */
+   g_free (proc_blurb);
+   g_free (proc_help);
+   g_free (proc_author);
+   g_free (proc_copyright);
+   g_free (proc_date);
+ 
  
    /*  Check the supplied number of arguments  */
    if ((nlength (a) - 1) != nparams)
***************
*** 553,558 ****
--- 564,571 ----
        g_snprintf (error_str, sizeof (error_str), 
  		  "Invalid arguments supplied to %s--(# args: %ld, expecting: %d)",
  		  proc_name, (nlength (a) - 1), nparams);
+       g_free (params);
+       g_free (return_vals);
        return my_err (error_str, NIL);
      }
  
***************
*** 676,683 ****
  
  		list = car (a);
  		num_strings = args[i - 1].data.d_int32;
! 		if (nlength (list) != num_strings)
  		  return my_err ("String array argument has incorrectly specified length", NIL);
  		array = args[i].data.d_stringarray = 
  		  g_new (char *, num_strings);
  
--- 689,700 ----
  
  		list = car (a);
  		num_strings = args[i - 1].data.d_int32;
! 		if (nlength (list) != num_strings) {
!     	          g_free(args);
!     	          g_free (params);
!     	          g_free (return_vals);
  		  return my_err ("String array argument has incorrectly specified length", NIL);
+ 		  }
  		array = args[i].data.d_stringarray = 
  		  g_new (char *, num_strings);
  
***************
*** 706,711 ****
--- 723,731 ----
  	  break;
  
  	case GIMP_PDB_REGION:
+     	  g_free(args);
+     	  g_free (params);
+     	  g_free (return_vals);
  	  return my_err ("Regions are currently unsupported as arguments", 
  			 car (a));
  	  break;
***************
*** 771,781 ****
--- 791,807 ----
  	  break;
  
  	case GIMP_PDB_BOUNDARY:
+     	  g_free(args);
+     	  g_free (params);
+     	  g_free (return_vals);
  	  return my_err ("Boundaries are currently unsupported as arguments", 
  			 car (a));
  	  break;
  
  	case GIMP_PDB_PATH:
+     	  g_free(args);
+     	  g_free (params);
+     	  g_free (return_vals);
  	  return my_err ("Paths are currently unsupported as arguments", 
  			 car (a));
  	  break;
***************
*** 807,826 ****
  	  break;
  
  	case GIMP_PDB_STATUS:
  	  return my_err ("Status is for return types, not arguments", car (a));
  	  break;
  
  	default:
  	  return my_err ("Unknown argument type", NIL);
  	}
  
        a = cdr (a);
      }
  
    if (success)
      values = gimp_run_procedure2 (proc_name, &nvalues, nparams, args);
!   else
      return my_err ("Invalid types specified for arguments", NIL);
  
    /*  Check the return status  */
    if (! values)
--- 833,863 ----
  	  break;
  
  	case GIMP_PDB_STATUS:
+     	  g_free(args);
+     	  g_free (params);
+     	  g_free (return_vals);
  	  return my_err ("Status is for return types, not arguments", car (a));
  	  break;
  
  	default:
+     	  g_free(args);
+     	  g_free (params);
+     	  g_free (return_vals);
  	  return my_err ("Unknown argument type", NIL);
  	}
  
        a = cdr (a);
      }
  
+ // memory leaks start here - cameron
    if (success)
      values = gimp_run_procedure2 (proc_name, &nvalues, nparams, args);
!   else {
!     g_free(args);
!     g_free (params);
!     g_free (return_vals);
      return my_err ("Invalid types specified for arguments", NIL);
+ 	}
  
    /*  Check the return status  */
    if (! values)
***************
*** 828,833 ****
--- 865,873 ----
        strcpy (error_str, "Procedural database execution did not return a status:\n    ");
        lprin1s (a_saved, error_str + strlen(error_str));
        
+       g_free(args);
+       g_free (params);
+       g_free (return_vals);
        return my_err (error_str, NIL);
      }
  
***************
*** 836,847 ****
--- 876,893 ----
      case GIMP_PDB_EXECUTION_ERROR:
  	  strcpy (error_str, "Procedural database execution failed:\n    ");
  	  lprin1s (a_saved, error_str + strlen(error_str));
+       g_free(args);
+       g_free (params);
+       g_free (return_vals);
        return my_err (error_str, NIL);
        break;
  
      case GIMP_PDB_CALLING_ERROR:
  	  strcpy (error_str, "Procedural database execution failed on invalid input arguments:\n    ");
  	  lprin1s (a_saved, error_str + strlen(error_str));
+       g_free(args);
+       g_free (params);
+       g_free (return_vals);
        return my_err (error_str, NIL);
        break;
  
***************
*** 894,899 ****
--- 940,948 ----
  	      break;
  
  	    case GIMP_PDB_INT16ARRAY:
+ 	      g_free(args);
+   	      g_free (params);
+ 	      g_free (return_vals);
  	      return my_err ("Arrays are currently unsupported as return values", NIL);
  	      break;
  
***************
*** 957,962 ****
--- 1006,1014 ----
  	      break;
  
  	    case GIMP_PDB_REGION:
+ 	      g_free(args);
+   	      g_free (params);
+ 	      g_free (return_vals);
  	      return my_err ("Regions are currently unsupported as return values", NIL);
  	      break;
  
***************
*** 991,1000 ****
--- 1043,1058 ----
  	      break;
  
  	    case GIMP_PDB_BOUNDARY:
+ 	      g_free(args);
+   	      g_free (params);
+ 	      g_free (return_vals);
  	      return my_err ("Boundaries are currently unsupported as return values", NIL);
  	      break;
  
  	    case GIMP_PDB_PATH:
+ 	      g_free(args);
+   	      g_free (params);
+ 	      g_free (return_vals);
  	      return my_err ("Paths are currently unsupported as return values", NIL);
  	      break;
  
***************
*** 1027,1036 ****
--- 1085,1100 ----
  	      break;
  
  	    case GIMP_PDB_STATUS:
+ 	      g_free(args);
+   	      g_free (params);
+ 	      g_free (return_vals);
  	      return my_err ("Procedural database execution returned multiple status values", NIL);
  	      break;
  
  	    default:
+ 	      g_free(args);
+   	      g_free (params);
+ 	      g_free (return_vals);
  	      return my_err ("Unknown return type", NIL);
  	    }
  	}
***************
*** 1048,1058 ****
    g_free (args);
  
    /*  free the query information  */
-   g_free (proc_blurb);
-   g_free (proc_help);
-   g_free (proc_author);
-   g_free (proc_copyright);
-   g_free (proc_date);
    g_free (params);
    g_free (return_vals);
  
--- 1112,1117 ----
