aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-09-22 04:36:48 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-09-22 04:36:48 +0800
commit4713393d8b19b2a2eca586389f8cc7c963a42156 (patch)
treea3180614937ef38c1773c05add8db96052fe0d33 /mail
parent8fb132dab0e8291ed8ac2017a329c23148cc5f1a (diff)
downloadgsoc2013-evolution-4713393d8b19b2a2eca586389f8cc7c963a42156.tar.gz
gsoc2013-evolution-4713393d8b19b2a2eca586389f8cc7c963a42156.tar.zst
gsoc2013-evolution-4713393d8b19b2a2eca586389f8cc7c963a42156.zip
Fixed some memory leakage. Call free_recipients() so we don't leak memory.
2000-09-21 Jeffrey Stedfast <fejj@helixcode.com> * mail-format.c (mail_generate_reply): Fixed some memory leakage. Call free_recipients() so we don't leak memory. svn path=/trunk/; revision=5542
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/mail-format.c16
-rw-r--r--mail/mail-ops.c15
3 files changed, 26 insertions, 10 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index eddc135122..93ef4c675d 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2000-09-21 Jeffrey Stedfast <fejj@helixcode.com>
+
+ * mail-format.c (mail_generate_reply): Fixed some memory
+ leakage. Call free_recipients() so we don't leak memory.
+
2000-09-19 Jeffrey Stedfast <fejj@helixcode.com>
* mail-ops.c (do_scan_subfolders): Use the folder's full_name so
diff --git a/mail/mail-format.c b/mail/mail-format.c
index 93ad41fbcb..8232f20d9e 100644
--- a/mail/mail-format.c
+++ b/mail/mail-format.c
@@ -1604,6 +1604,16 @@ mail_get_message_body (CamelDataWrapper *data, gboolean want_plain, gboolean *is
return text;
}
+static void
+free_recipients (GList *list)
+{
+ GList *l;
+
+ for (l = list; l; l = l->next)
+ g_free (l->data);
+ g_list_free (list);
+}
+
EMsgComposer *
mail_generate_reply (CamelMimeMessage *message, gboolean to_all)
{
@@ -1714,7 +1724,7 @@ mail_generate_reply (CamelMimeMessage *message, gboolean to_all)
fulladdr = g_strdup_printf ("\"%s\" <%s>", name, addr);
} else
fulladdr = g_strdup (addr);
-
+
if (strcmp (addr, id->address) != 0)
cc = g_list_append (cc, fulladdr);
}
@@ -1733,8 +1743,8 @@ mail_generate_reply (CamelMimeMessage *message, gboolean to_all)
}
e_msg_composer_set_headers (composer, to, cc, NULL, subject);
- g_list_free (to);
- g_list_free (cc);
+ free_recipients (to);
+ free_recipients (cc);
g_free (subject);
/* Add In-Reply-To and References. */
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 98adc3ca3a..6d049fdfe1 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -5,6 +5,7 @@
* Author :
* Dan Winship <danw@helixcode.com>
* Peter Williams <peterw@helixcode.com>
+ * Jeffrey Stedfast <fejj@helixcode.com>
*
* Copyright 2000 Helix Code, Inc. (http://www.helixcode.com)
*
@@ -62,15 +63,15 @@ describe_fetch_mail (gpointer in_data, gboolean gerund)
{
fetch_mail_input_t *input = (fetch_mail_input_t *) in_data;
char *name;
-
+
/*source = camel_session_get_store (session, input->source_url, NULL);
*if (source) {
* name = camel_service_get_name (CAMEL_SERVICE (source), FALSE);
* camel_object_unref (CAMEL_OBJECT (source));
*} else
*/
- name = input->source_url;
-
+ name = input->source_url;
+
if (gerund)
return g_strdup_printf (_("Fetching email from %s"), name);
else
@@ -82,23 +83,23 @@ setup_fetch_mail (gpointer in_data, gpointer op_data, CamelException *ex)
{
fetch_mail_input_t *input = (fetch_mail_input_t *) in_data;
fetch_mail_data_t *data = (fetch_mail_data_t *) op_data;
-
+
if (!input->source_url) {
camel_exception_set (ex, CAMEL_EXCEPTION_INVALID_PARAM,
_("You have no remote mail source configured "
"to fetch mail from."));
return;
}
-
+
if (input->destination == NULL)
return;
-
+
if (!CAMEL_IS_FOLDER (input->destination)) {
camel_exception_set (ex, CAMEL_EXCEPTION_INVALID_PARAM,
_("Bad folder passed to fetch_mail"));
return;
}
-
+
data->empty = FALSE;
camel_object_ref (CAMEL_OBJECT (input->destination));
}