[evolution/wip/gsettings] Fix few memory leaks



commit d09867f70ab6fcd4e8bc93e4ebc2b6f7383b5bb7
Author: Milan Crha <mcrha redhat com>
Date:   Wed Jun 15 14:38:44 2011 +0200

    Fix few memory leaks

 mail/e-mail-session.c  |    3 +++
 mail/em-folder-tree.c  |   14 +++++++++++---
 mail/em-folder-utils.c |    3 +++
 3 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/mail/e-mail-session.c b/mail/e-mail-session.c
index 061311c..6b38d70 100644
--- a/mail/e-mail-session.c
+++ b/mail/e-mail-session.c
@@ -1258,6 +1258,9 @@ e_mail_session_uri_to_folder_sync (EMailSession *session,
 		mail_folder_cache_note_folder (folder_cache, folder);
 	}
 
+	g_free (folder_name);
+	g_object_unref (store);
+
 	return folder;
 }
 
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index 46f3fc8..8284be4 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -916,10 +916,14 @@ folder_tree_finalize (GObject *object)
 			priv->select_uris,
 			(GFunc) folder_tree_free_select_uri, NULL);
 		g_slist_free (priv->select_uris);
-		g_hash_table_destroy (priv->select_uris_table);
 		priv->select_uris = NULL;
 	}
 
+	if (priv->select_uris_table) {
+		g_hash_table_destroy (priv->select_uris_table);
+		priv->select_uris_table = NULL;
+	}
+
 	/* Chain up to parent's finalize() method. */
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
@@ -2052,6 +2056,7 @@ folder_tree_drop_async__desc (struct _DragDataReceivedAsync *m)
 
 	if (m->info == DND_DROP_TYPE_FOLDER) {
 		gchar *folder_name = NULL;
+		gchar *res;
 
 		e_mail_folder_uri_parse (
 			CAMEL_SESSION (m->session),
@@ -2059,11 +2064,14 @@ folder_tree_drop_async__desc (struct _DragDataReceivedAsync *m)
 		g_return_val_if_fail (folder_name != NULL, NULL);
 
 		if (m->move)
-			return g_strdup_printf (
+			res = g_strdup_printf (
 				_("Moving folder %s"), folder_name);
 		else
-			return g_strdup_printf (
+			res = g_strdup_printf (
 				_("Copying folder %s"), folder_name);
+		g_free (folder_name);
+
+		return res;
 	} else {
 		if (m->move)
 			return g_strdup_printf (
diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c
index 63931fb..e5a3543 100644
--- a/mail/em-folder-utils.c
+++ b/mail/em-folder-utils.c
@@ -398,6 +398,9 @@ fail:
 	g_object_unref (cfd->source_store);
 	g_free (cfd->source_folder_name);
 	g_free (cfd);
+
+	if (tostore)
+		g_object_unref (tostore);
 	g_free (tobase);
 }
 



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