[nautilus-sendto/gnome-2-32] Fix a few memory leaks



commit 1f237869181802649dfb2567c20a6e80e9ee07f1
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Aug 16 16:21:05 2010 +0100

    Fix a few memory leaks
    
    On startup, and when sending packed files
    
    https://bugzilla.gnome.org/show_bug.cgi?id=626754

 src/nautilus-sendto-command.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/nautilus-sendto-command.c b/src/nautilus-sendto-command.c
index 1496411..b384b54 100644
--- a/src/nautilus-sendto-command.c
+++ b/src/nautilus-sendto-command.c
@@ -262,7 +262,7 @@ status_label_clear (gpointer data)
 static void
 send_button_cb (GtkWidget *widget, NS_ui *ui)
 {
-	char *f, *error;
+	char *error;
 	NstPlugin *p;
 	GtkWidget *w;
 
@@ -303,11 +303,14 @@ send_button_cb (GtkWidget *widget, NS_ui *ui)
 			       p->info->id);
 
 	if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(ui->pack_checkbutton))){
+		char *f;
+
 		f = pack_files (ui);
 		if (f != NULL) {
 			GList *packed_file = NULL;
 			packed_file = g_list_append (packed_file, f);
 			if (!p->info->send_files (p, w, packed_file)) {
+				g_free (f);
 				g_list_free (packed_file);
 				return;
 			}
@@ -316,6 +319,7 @@ send_button_cb (GtkWidget *widget, NS_ui *ui)
 			gtk_widget_set_sensitive (ui->dialog, TRUE);
 			return;
 		}
+		g_free (f);
 	} else {
 		if (!p->info->send_files (p, w, file_list)) {
 			g_list_foreach (file_list, (GFunc) g_free, NULL);
@@ -761,6 +765,7 @@ nautilus_sendto_init (void)
 
 		file = g_file_new_for_commandline_arg (filenames[i]);
 		filename = g_file_get_path (file);
+		g_object_unref (file);
 		if (filename == NULL)
 			continue;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]