changeset 1947:e0631236c970

[gaim-migrate @ 1957] heh. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 01 Jun 2001 23:29:09 +0000
parents 4e93ea84f7dd
children 30f7c8f9c6b9
files src/perl.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/perl.c	Fri Jun 01 23:25:26 2001 +0000
+++ b/src/perl.c	Fri Jun 01 23:29:09 2001 +0000
@@ -617,18 +617,22 @@
 }
 
 static void do_load(GtkWidget *m, gpointer n) {
-	gchar* file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(config));
-	if (!file || !strlen(file)) {
+	const char *f = gtk_file_selection_get_filename(GTK_FILE_SELECTION(config));
+	gchar* file;
+	if (!f || !strlen(f)) {
 		perl_end();
 		perl_init();
 		return;
 	}
+	file = g_strdup(f);
 	
 	if (file_is_dir(file, config)) {
+		g_free(file);
 		return;
 	}
 	
 	if (last_dir) {
+		g_free(file);
 		g_free(last_dir);
 	}
 	last_dir = g_dirname(file);
@@ -637,6 +641,7 @@
 	
 	perl_load_file(file);
 	cfdes(config, NULL);
+	g_free(file);
 }
 
 void load_perl_script(GtkWidget *w, gpointer d)