diff options
author | Milan Crha <mcrha@redhat.com> | 2012-05-31 16:44:49 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-05-31 16:44:49 +0800 |
commit | 71924fc48776c642fe8520febc384250cf55973c (patch) | |
tree | 6b2f1738675f111dfb664805f82ad27add135715 /plugins | |
parent | c88d3170304e1892b221d0581a3cd3c767de4281 (diff) | |
download | gsoc2013-evolution-71924fc48776c642fe8520febc384250cf55973c.tar.gz gsoc2013-evolution-71924fc48776c642fe8520febc384250cf55973c.tar.zst gsoc2013-evolution-71924fc48776c642fe8520febc384250cf55973c.zip |
Fix memory leaks around gtk_tree_model_get() function
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/attachment-reminder/attachment-reminder.c | 2 | ||||
-rw-r--r-- | plugins/imap-features/imap-headers.c | 2 | ||||
-rw-r--r-- | plugins/templates/templates.c | 12 |
3 files changed, 14 insertions, 2 deletions
diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index 762594517b..5f3494175e 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -351,6 +351,8 @@ commit_changes (UIData *ui) /* Check if the keyword is not empty */ if ((keyword) && (g_utf8_strlen (g_strstrip (keyword), -1) > 0)) g_variant_builder_add (&b, "s", keyword); + g_free (keyword); + valid = gtk_tree_model_iter_next (model, &iter); } diff --git a/plugins/imap-features/imap-headers.c b/plugins/imap-features/imap-headers.c index 3a0917fa53..56f7e4f5b4 100644 --- a/plugins/imap-features/imap-headers.c +++ b/plugins/imap-features/imap-headers.c @@ -168,10 +168,12 @@ epif_add_sensitivity (EPImapFeaturesData *ui) 0, &header_name, -1); if (g_ascii_strcasecmp (header_name, entry_contents) == 0) { + g_free (header_name); gtk_widget_set_sensitive (GTK_WIDGET (ui->add_header), FALSE); return; } + g_free (header_name); valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (ui->store), &iter); } diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c index 75891641e2..4359af01b9 100644 --- a/plugins/templates/templates.c +++ b/plugins/templates/templates.c @@ -169,8 +169,10 @@ commit_changes (UIData *ui) gchar *keyword, *value; gchar *key; - gtk_tree_model_get (model, &iter, CLUE_KEYWORD_COLUMN, &keyword, -1); - gtk_tree_model_get (model, &iter, CLUE_VALUE_COLUMN, &value, -1); + gtk_tree_model_get (model, &iter, + CLUE_KEYWORD_COLUMN, &keyword, + CLUE_VALUE_COLUMN, &value, + -1); /* Check if the keyword and value are not empty */ if ((keyword) && (value) && (g_utf8_strlen (g_strstrip (keyword), -1) > 0) @@ -178,6 +180,10 @@ commit_changes (UIData *ui) key = g_strdup_printf("%s=%s", keyword, value); g_variant_builder_add (&b, "s", key); } + + g_free (keyword); + g_free (value); + valid = gtk_tree_model_iter_next (model, &iter); } @@ -260,6 +266,7 @@ key_cell_edited_callback (GtkCellRendererText *cell, gtk_tree_model_get (model, &iter, CLUE_VALUE_COLUMN, &value, -1); gtk_list_store_set (GTK_LIST_STORE (model), &iter, CLUE_KEYWORD_COLUMN, new_text, CLUE_VALUE_COLUMN, value, -1); + g_free (value); commit_changes (ui); } @@ -282,6 +289,7 @@ value_cell_edited_callback (GtkCellRendererText *cell, gtk_list_store_set (GTK_LIST_STORE (model), &iter, CLUE_KEYWORD_COLUMN, keyword, CLUE_VALUE_COLUMN, new_text, -1); + g_free (keyword); commit_changes (ui); } |