aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-06-15 20:38:44 +0800
committerMilan Crha <mcrha@redhat.com>2011-06-15 20:38:44 +0800
commitb0044ca55a85e778a919442e9715d068662c4339 (patch)
tree0d1a9139d3ea9a0bdd060e703d25894ce0fcd8a6 /mail
parente4b480c8d791a368b72010f978696998bba75e5d (diff)
downloadgsoc2013-evolution-b0044ca55a85e778a919442e9715d068662c4339.tar.gz
gsoc2013-evolution-b0044ca55a85e778a919442e9715d068662c4339.tar.zst
gsoc2013-evolution-b0044ca55a85e778a919442e9715d068662c4339.zip
Fix few memory leaks
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-session.c3
-rw-r--r--mail/em-folder-tree.c14
-rw-r--r--mail/em-folder-utils.c3
3 files changed, 17 insertions, 3 deletions
diff --git a/mail/e-mail-session.c b/mail/e-mail-session.c
index 061311c820..6b38d707da 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 46f3fc82ba..8284be42f3 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 63931fba6d..e5a3543fdc 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);
}