From b9cf3b581ecbd4f0bcba7340f04447059c197a0e Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Tue, 31 Mar 2009 11:57:48 +0000 Subject: [PATCH 1/1] Avoid freeing a string before using it in modest_mail_operation_queue_to_string. pmo-trunk-r8498 --- src/modest-mail-operation-queue.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modest-mail-operation-queue.c b/src/modest-mail-operation-queue.c index cb466e0..68506d9 100644 --- a/src/modest-mail-operation-queue.c +++ b/src/modest-mail-operation-queue.c @@ -513,8 +513,10 @@ modest_mail_operation_queue_to_string (ModestMailOperationQueue *self) len = g_queue_get_length (priv->op_queue); str = g_strdup_printf ("mail operation queue (%02d)\n-------------------------", len); if (len == 0) { - g_free (str); - str = g_strdup_printf ("%s\n%s", str, ""); + gchar *copy; + copy = str; + str = g_strdup_printf ("%s\n%s", copy, ""); + g_free (copy); } else { g_mutex_lock (priv->queue_lock); g_queue_foreach (priv->op_queue, (GFunc)accumulate_mail_op_strings, &str); -- 1.7.9.5