Re: [evolution-patches] Evolution - mail, fixes a multiple free in folder ops.



Hi,

Thanks for the comment. I have modified it and attached the 
patch.

Thanks,
Arunprakash.

On Fri, 2005-07-29 at 09:27 +0800, Not Zed wrote:
> This isn't a correct fix.  Instead, you should g_strdup the value when
> it is set using g_object_set_data().  The folder is not reffed when it
> does that, so that string needs to be copied.
> 
> On Thu, 2005-07-28 at 21:17 +0530, Arunprakash wrote:
> > Hi,
> > 
> > Attached patch fixes a multiple free in popping
> > a error dialog and destroying it, in folder
> > delete operation.
> > 
> > Please review it.
> > 
> > Thanks,
> > Arunprakash.
> > 

Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3664
diff -u -p -r1.3664 ChangeLog
--- mail/ChangeLog	28 Jul 2005 06:45:05 -0000	1.3664
+++ mail/ChangeLog	29 Jul 2005 08:18:19 -0000
@@ -1,3 +1,9 @@
+2005-07-28  Arunprakash <arunp novell com>
+
+	* mail/em-folder-utils.c (em_folder_utils_delete_folder) : Allocated
+	a new string to be used for the error dialog response to avoid
+	multiple frees.
+	
 2005-07-28  Praveen Kumar <kpraveen novell com>
 
 	* em-account-editor.c (emae_check_complete) : Update the "Full Name" 
Index: mail/em-folder-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-utils.c,v
retrieving revision 1.4
diff -u -p -r1.4 em-folder-utils.c
--- mail/em-folder-utils.c	21 Jul 2005 04:15:21 -0000	1.4
+++ mail/em-folder-utils.c	29 Jul 2005 08:18:20 -0000
@@ -468,6 +468,7 @@ em_folder_utils_delete_folder (CamelFold
 {
 	CamelStore *local;
 	GtkWidget *dialog;
+	gchar *folder_name;
 
 	local = mail_component_peek_local_store (NULL);
 	
@@ -481,7 +482,8 @@ em_folder_utils_delete_folder (CamelFold
 	dialog = e_error_new(NULL,
 			     (folder->parent_store && CAMEL_IS_VEE_STORE(folder->parent_store))?"mail:ask-delete-vfolder":"mail:ask-delete-folder",
 			     folder->full_name, NULL);
-	g_object_set_data_full ((GObject *) dialog, "full_name", folder->full_name, g_free);
+	folder_name = g_strdup (folder->full_name);
+	g_object_set_data_full ((GObject *) dialog, "full_name", folder_name, g_free);
 	g_object_set_data_full ((GObject *) dialog, "store", folder->parent_store, camel_object_unref);
 	g_signal_connect (dialog, "response", G_CALLBACK (emfu_delete_response), NULL);
 	gtk_widget_show (dialog);


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