aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/templates/templates.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-01-06 22:52:23 +0800
committerMilan Crha <mcrha@redhat.com>2011-01-06 22:52:23 +0800
commitd61a48b9d9bcf8d315b05ffb8be10b3d9d64c0ee (patch)
tree3d5004fadd6d951e47f4171ef6f5b9cd29d26917 /plugins/templates/templates.c
parent81f14a09c8624937c752ae315a66928eb31a2f6d (diff)
downloadgsoc2013-evolution-d61a48b9d9bcf8d315b05ffb8be10b3d9d64c0ee.tar.gz
gsoc2013-evolution-d61a48b9d9bcf8d315b05ffb8be10b3d9d64c0ee.tar.zst
gsoc2013-evolution-d61a48b9d9bcf8d315b05ffb8be10b3d9d64c0ee.zip
Bug #633854 - [templates] Crash in build_template_menus_recurse
Diffstat (limited to 'plugins/templates/templates.c')
-rw-r--r--plugins/templates/templates.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c
index 625c70245b..9b664bbe55 100644
--- a/plugins/templates/templates.c
+++ b/plugins/templates/templates.c
@@ -567,10 +567,10 @@ build_template_menus_recurse (GtkUIManager *ui_manager,
gchar *path;
guint ii;
+ folder_name = folder_info->name;
/* FIXME Not passing a GCancellable or GError here. */
folder = camel_store_get_folder_sync (
store, folder_info->full_name, 0, NULL, NULL);
- folder_name = camel_folder_get_name (folder);
action_name = g_strdup_printf (
"templates-menu-%d", *action_count);
@@ -603,9 +603,15 @@ build_template_menus_recurse (GtkUIManager *ui_manager,
path, action_count, merge_id,
folder_info->child, message_folder, message_uid);
+ if (!folder) {
+ g_free (path);
+ folder_info = folder_info->next;
+ continue;
+ }
+
/* Get the UIDs for this folder and add them to the menu. */
uids = camel_folder_get_uids (folder);
- for (ii = 0; ii < uids->len; ii++) {
+ for (ii = 0; uids && ii < uids->len; ii++) {
CamelMimeMessage *template;
const gchar *uid = uids->pdata[ii], *muid;
guint32 flags;
@@ -666,8 +672,9 @@ build_template_menus_recurse (GtkUIManager *ui_manager,
g_object_unref (action);
g_free (action_name);
}
- camel_folder_free_uids (folder, uids);
+ camel_folder_free_uids (folder, uids);
+ g_object_unref (folder);
g_free (path);
folder_info = folder_info->next;