Re: [evolution-patches] Patches for leaks in evolution



tir, 05,.07.2005 kl. 23.46 +0800, skrev Not Zed:
> On Tue, 2005-07-05 at 15:14 +0200, Kjartan Maraas wrote:
> > tir, 05,.07.2005 kl. 15.12 +0200, skrev Kjartan Maraas:
> > > Hi.
> > > 
> > > This is a set of leak fixes found by use of valgrind. Please review.
> > > 
> > Well, if I had remembered to enter the ssh password after doing cvs diff
> > the file would probably have had content also :-)
> 
> Yes that helps.
> 
> Any chance of changelogs?  They all look good to me though, thanks.
> 
Attaching new version including ChangeLog entries.

Could you take a look at the message-list.c change? That's a new one
since the previous patch.

Cheers
Kjartan

Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2762
diff -u -p -r1.2762 ChangeLog
--- calendar/ChangeLog	6 Jul 2005 13:31:28 -0000	1.2762
+++ calendar/ChangeLog	7 Jul 2005 09:43:09 -0000
@@ -1,3 +1,8 @@
+2005-07-07  Kjartan Maraas  <kmaraas gnome org>
+
+	* gui/calendar-config.c: (calendar_config_get_icaltimezone):
+	Free the timezone location.
+
 2005-07-06  Chenthill Palanisamy  <pchenthill novell com>
 
 	* gui/dialogs/event-page.c: (sensitize_widgets): Enable alarms
Index: calendar/gui/calendar-config.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/calendar-config.c,v
retrieving revision 1.76
diff -u -p -r1.76 calendar-config.c
--- calendar/gui/calendar-config.c	17 Jun 2005 15:20:27 -0000	1.76
+++ calendar/gui/calendar-config.c	7 Jul 2005 09:43:09 -0000
@@ -195,9 +195,10 @@ calendar_config_get_icaltimezone (void)
 	calendar_config_init ();
 	
 	location = calendar_config_get_timezone ();
-	if (location)
+	if (location) {
 		zone = icaltimezone_get_builtin_timezone (location);
-
+		g_free (location);
+	}
 	if (!zone)
 		zone = icaltimezone_get_utc_timezone ();
 	
Index: composer/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/composer/ChangeLog,v
retrieving revision 1.700
diff -u -p -r1.700 ChangeLog
--- composer/ChangeLog	3 Jun 2005 09:52:02 -0000	1.700
+++ composer/ChangeLog	7 Jul 2005 09:43:09 -0000
@@ -1,3 +1,9 @@
+2005-07-07  Kjartan Maraas  <kmaraas gnome org>
+
+	* e-msg-composer-select-file.c: (select_attach_response): Don't
+	leak the file name here.
+	* e-msg-composer.c: (build_message): Don't allocate charset twice.
+
 2005-06-03  Srinivasa Ragavan <sragavan novell com>
 
 	* e-msg-composer.c (e_msg_composer_attach): Fixed to show the
Index: composer/e-msg-composer-select-file.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer-select-file.c,v
retrieving revision 1.35
diff -u -p -r1.35 e-msg-composer-select-file.c
--- composer/e-msg-composer-select-file.c	3 Jun 2005 04:20:57 -0000	1.35
+++ composer/e-msg-composer-select-file.c	7 Jul 2005 09:43:09 -0000
@@ -194,8 +194,11 @@ select_attach_response(GtkWidget *select
 		char *path;
 
 #ifdef USE_GTKFILECHOOSER
+		char *filename;
 		names = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER (selector));
-		path = g_path_get_dirname (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (selector)));
+		filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (selector));
+		path = g_path_get_dirname (filename);
+		g_free (filename);
 #else
 		char **files;
 		int i;
Index: composer/e-msg-composer.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer.c,v
retrieving revision 1.512
diff -u -p -r1.512 e-msg-composer.c
--- composer/e-msg-composer.c	23 Jun 2005 09:11:06 -0000	1.512
+++ composer/e-msg-composer.c	7 Jul 2005 09:43:20 -0000
@@ -491,7 +491,7 @@ build_message (EMsgComposer *composer, g
 		}
 		
 		/* FIXME: we may want to do better than this... */
-		charset = best_charset (data, composer->charset, &plain_encoding);
+
 		type = camel_content_type_new ("text", "plain");
 		if ((charset = best_charset (data, composer->charset, &plain_encoding))) {
 			camel_content_type_set_param (type, "charset", charset);
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3652
diff -u -p -r1.3652 ChangeLog
--- mail/ChangeLog	6 Jul 2005 04:54:32 -0000	1.3652
+++ mail/ChangeLog	7 Jul 2005 09:43:48 -0000
@@ -1,3 +1,11 @@
+2005-07-07  Kjartan Maraas  <kmaraas gnome org>
+
+	* em-mailer-prefs.c: (em_mailer_prefs_construct): Free
+	the font name here.
+	* mail-config.c: (config_write_style): Free font names and
+	citation_color here.
+	* message-list.c: (regen_list_free): Plug a leak here too. 
+
 2005-07-06  Vivek Jain <jvivek novell com>
 	
 	* em-junk-filter.c : moved to plugins/sa-junk-plugin
Index: mail/em-mailer-prefs.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-mailer-prefs.c,v
retrieving revision 1.30
diff -u -p -r1.30 em-mailer-prefs.c
--- mail/em-mailer-prefs.c	23 Jun 2005 09:11:06 -0000	1.30
+++ mail/em-mailer-prefs.c	7 Jul 2005 09:43:48 -0000
@@ -814,6 +814,7 @@ em_mailer_prefs_construct (EMMailerPrefs
 	font = gconf_client_get_string (prefs->gconf, "/apps/evolution/mail/display/fonts/variable", NULL);
 	prefs->font_variable = GNOME_FONT_PICKER (glade_xml_get_widget (gui, "FontVariable"));
 	gnome_font_picker_set_font_name (prefs->font_variable, font);
+	g_free (font);
 	g_object_set_data ((GObject *) prefs->font_variable, "key", "/apps/evolution/mail/display/fonts/variable");
 	g_signal_connect (prefs->font_variable, "font-set", G_CALLBACK (font_changed), prefs);
 	if (!gconf_client_key_is_writable (prefs->gconf, "/apps/evolution/mail/display/fonts/variable", NULL))
Index: mail/mail-config.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-config.c,v
retrieving revision 1.317
diff -u -p -r1.317 mail-config.c
--- mail/mail-config.c	23 Jun 2005 09:11:06 -0000	1.317
+++ mail/mail-config.c	7 Jul 2005 09:43:50 -0000
@@ -249,6 +249,7 @@ config_write_style (void)
 	gboolean custom;
 	char *fix_font;
 	char *var_font;
+	char *citation_color;
 	FILE *rc;
 	
 	if (!(rc = fopen (config->gtkrc, "wt"))) {
@@ -259,7 +260,7 @@ config_write_style (void)
 	custom = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/display/fonts/use_custom", NULL);
 	var_font = gconf_client_get_string (config->gconf, "/apps/evolution/mail/display/fonts/variable", NULL);
 	fix_font = gconf_client_get_string (config->gconf, "/apps/evolution/mail/display/fonts/monospace", NULL);
-
+	citation_color = gconf_client_get_string (config->gconf, "/apps/evolution/mail/display/citation_colour", NULL);
  	CONFIG_GET_SPELL_VALUE (int, "/spell_error_color_red",   red, (void)0, (int));
  	CONFIG_GET_SPELL_VALUE (int, "/spell_error_color_green", green, (void)0, (int));
  	CONFIG_GET_SPELL_VALUE (int, "/spell_error_color_blue",  blue, (void)0, (int));
@@ -270,7 +271,8 @@ config_write_style (void)
 
 	if (gconf_client_get_bool (config->gconf, "/apps/evolution/mail/display/mark_citations", NULL))
 		fprintf (rc, "        GtkHTML::cite_color = \"%s\"\n",
-			 gconf_client_get_string (config->gconf, "/apps/evolution/mail/display/citation_colour", NULL));
+			 citation_color);
+	g_free (citation_color);
 
 	if (custom && var_font && fix_font) {
 		fprintf (rc,
@@ -278,6 +280,9 @@ config_write_style (void)
 			 "        font_name = \"%s\"\n",
 			 fix_font, var_font); 
 	}
+	g_free (fix_font);
+	g_free (var_font);
+
 	fprintf (rc, "}\n\n");
 	
 	fprintf (rc, "widget \"*.EMFolderView.*.GtkHTML\" style \"evolution-mail-custom-fonts\"\n");
Index: mail/message-list.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/message-list.c,v
retrieving revision 1.417
diff -u -p -r1.417 message-list.c
--- mail/message-list.c	23 Jun 2005 09:11:07 -0000	1.417
+++ mail/message-list.c	7 Jul 2005 09:44:02 -0000
@@ -3618,6 +3618,7 @@ regen_list_free (struct _mail_msg *mm)
 	if (m->tree)
 		camel_folder_thread_messages_unref (m->tree);
 	
+	g_free (m->search);
 	g_free (m->hideexpr);
 	
 	camel_object_unref (m->folder);
Index: shell/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/shell/ChangeLog,v
retrieving revision 1.1527
diff -u -p -r1.1527 ChangeLog
--- shell/ChangeLog	1 Jul 2005 10:15:49 -0000	1.1527
+++ shell/ChangeLog	7 Jul 2005 09:44:06 -0000
@@ -1,3 +1,7 @@
+2005-07-07  Kjartan Maraas  <kmaraas gnome org>
+
+	* e-shell-window.c: (setup_widgets): Free the style here.
+
 2005-06-24  Harish Krishnaswamy <kharish novell com> 
 
 	(patch submitted by Andre Klapper <a9016009 gmx de>)
Index: shell/e-shell-window.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-window.c,v
retrieving revision 1.34
diff -u -p -r1.34 e-shell-window.c
--- shell/e-shell-window.c	16 May 2005 04:46:40 -0000	1.34
+++ shell/e-shell-window.c	7 Jul 2005 09:44:06 -0000
@@ -670,6 +670,7 @@ setup_widgets (EShellWindow *window)
 		
 		e_sidebar_set_mode (E_SIDEBAR (priv->sidebar), mode);
 	}
+	g_free (style);
 
 	/* The tool bar */
 	visible = gconf_client_get_bool (gconf_client,





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