From: Sergio Villar Senin Date: Tue, 17 Mar 2009 19:30:33 +0000 (+0000) Subject: Fixes leak 16/26 X-Git-Tag: git_migration_finished~284 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=464e5b59df121d3c2315df838998d948c48bd6d3;ds=sidebyside Fixes leak 16/26 pmo-trunk-r8120 --- diff --git a/src/modest-mail-operation-queue.c b/src/modest-mail-operation-queue.c index 01a36b9..cb02a9f 100644 --- a/src/modest-mail-operation-queue.c +++ b/src/modest-mail-operation-queue.c @@ -499,19 +499,20 @@ accumulate_mail_op_strings (ModestMailOperation *op, gchar **str) gchar* modest_mail_operation_queue_to_string (ModestMailOperationQueue *self) { - gchar *str; + gchar *str = NULL; guint len; ModestMailOperationQueuePrivate *priv; - + g_return_val_if_fail (MODEST_IS_MAIL_OPERATION_QUEUE (self), NULL); - + priv = MODEST_MAIL_OPERATION_QUEUE_GET_PRIVATE(self); len = g_queue_get_length (priv->op_queue); str = g_strdup_printf ("mail operation queue (%02d)\n-------------------------", len); - if (len == 0) + if (len == 0) { + g_free (str); str = g_strdup_printf ("%s\n%s", str, ""); - else { + } else { g_mutex_lock (priv->queue_lock); g_queue_foreach (priv->op_queue, (GFunc)accumulate_mail_op_strings, &str); g_mutex_unlock (priv->queue_lock);