[evolution] Fix two memory leaks
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Fix two memory leaks
- Date: Wed, 26 Mar 2014 15:49:25 +0000 (UTC)
commit 733462ca84044f3fe956b4578870ab7698242fd6
Author: Milan Crha <mcrha redhat com>
Date: Wed Mar 26 16:48:03 2014 +0100
Fix two memory leaks
a) ETableColumnSpecification: the 'title' property is always overwritten
during the spec file loading, thus no need to allocate it here
b) the 'uids' are leaked on message move, because the GPtrArray is
supposed to be always unreffed
e-util/e-table-column-specification.c | 2 +-
mail/e-mail-reader.c | 8 ++------
2 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/e-util/e-table-column-specification.c b/e-util/e-table-column-specification.c
index befde72..da42a41 100644
--- a/e-util/e-table-column-specification.c
+++ b/e-util/e-table-column-specification.c
@@ -72,7 +72,7 @@ e_table_column_specification_init (ETableColumnSpecification *specification)
{
specification->model_col = 0;
specification->compare_col = 0;
- specification->title = g_strdup ("");
+ specification->title = NULL;
specification->pixbuf = NULL;
specification->expansion = 0;
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index e1c477e..b7d380a 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -868,20 +868,16 @@ action_mail_move_cb (GtkAction *action,
g_free (default_xfer_messages_uri);
default_xfer_messages_uri = g_strdup (uri);
- if (uri != NULL) {
+ if (uri != NULL)
mail_transfer_messages (
session, folder, uids,
TRUE, uri, 0, NULL, NULL);
- uids = NULL;
- }
exit:
- if (uids != NULL)
- g_ptr_array_unref (uids);
-
gtk_widget_destroy (dialog);
g_clear_object (&folder);
+ g_ptr_array_unref (uids);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]