From bfce74050f419051f9319bb6313e3d7c7c89ce9d Mon Sep 17 00:00:00 2001 From: Chris Heath Date: Fri, 9 Jun 2006 01:21:54 +0000 Subject: [PATCH] Fix memory leak. Fixes bug #335423. 2006-06-09 Chris Heath * camel/camel-net-utils.c (camel_getnameinfo): * camel/camel-folder-search.c (camel_folder_search_search): * camel/camel-digest-folder.c (digest_add_multipart): * camel/providers/groupwise/camel-groupwise-journal.c (update_cache): * camel/providers/imap4/camel-imap4-journal.c (camel_imap4_journal_append): * camel/providers/local/camel-local-summary.c (message_info_new_from_header): * camel/providers/local/camel-mbox-summary.c (message_info_new_from_header): * camel/providers/nntp/camel-nntp-summary.c (message_info_new_from_header): * camel/providers/pop3/camel-pop3-engine.c (camel_pop3_engine_finalise): * libedataserverui/e-name-selector-dialog.c (search_changed): Fix memory leak. Fixes bug #335423. --- camel/ChangeLog | 7 +++++++ camel/camel-digest-folder.c | 1 + camel/camel-folder-search.c | 1 + camel/camel-net-utils.c | 11 ++++++----- camel/providers/groupwise/ChangeLog | 5 +++++ camel/providers/groupwise/camel-groupwise-journal.c | 1 + camel/providers/imap4/ChangeLog | 5 +++++ camel/providers/imap4/camel-imap4-journal.c | 1 + camel/providers/local/ChangeLog | 6 ++++++ camel/providers/local/camel-local-summary.c | 1 + camel/providers/local/camel-mbox-summary.c | 1 + camel/providers/nntp/ChangeLog | 5 +++++ camel/providers/nntp/camel-nntp-summary.c | 3 ++- camel/providers/pop3/ChangeLog | 5 +++++ camel/providers/pop3/camel-pop3-engine.c | 4 ++++ libedataserverui/ChangeLog | 5 +++++ libedataserverui/e-name-selector-dialog.c | 3 +-- 17 files changed, 57 insertions(+), 8 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index 776a672..04b0c44 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2006-06-09 Chris Heath + + * camel-net-utils.c (camel_getnameinfo): Fix memory leak + * camel-folder-search.c (camel_folder_search_search): Ditto + * camel-digest-folder.c (digest_add_multipart): Ditto. + Fixes bug #335423. + 2006-06-02 Tor Lillqvist * camel-file-utils.c (camel_read, camel_write, camel_read_socket) diff --git a/camel/camel-digest-folder.c b/camel/camel-digest-folder.c index bf592ff..07acbe2 100644 --- a/camel/camel-digest-folder.c +++ b/camel/camel-digest-folder.c @@ -196,6 +196,7 @@ digest_add_multipart (CamelFolder *folder, CamelMultipart *multipart, const char } info = camel_folder_summary_info_new_from_message (folder->summary, CAMEL_MIME_MESSAGE (wrapper)); + g_free(info->uid); info->uid = g_strdup_printf ("%s%d", preuid, i); camel_folder_summary_add (folder->summary, info); } diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c index 866c819..dc1198e 100644 --- a/camel/camel-folder-search.c +++ b/camel/camel-folder-search.c @@ -463,6 +463,7 @@ camel_folder_search_search(CamelFolderSearch *search, const char *expr, GPtrArra for (i=0;isummary->len;i++) if (g_hash_table_lookup(uids_hash, camel_message_info_uid(search->summary->pdata[i]))) g_ptr_array_add(search->summary_set, search->summary->pdata[i]); + g_hash_table_destroy(uids_hash); } else { summary_set = search->summary; } diff --git a/camel/camel-net-utils.c b/camel/camel-net-utils.c index d8dfb59..e628da8 100644 --- a/camel/camel-net-utils.c +++ b/camel/camel-net-utils.c @@ -816,11 +816,12 @@ camel_getnameinfo(const struct sockaddr *sa, socklen_t salen, char **host, char if ((result = msg->result) != 0) camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Name lookup failed: %s"), gai_strerror (result)); - - if (host) - *host = g_strdup(msg->host); - if (serv) - *serv = g_strdup(msg->serv); + else { + if (host) + *host = g_strdup(msg->host); + if (serv) + *serv = g_strdup(msg->serv); + } g_free(msg->host); g_free(msg->serv); diff --git a/camel/providers/groupwise/ChangeLog b/camel/providers/groupwise/ChangeLog index f71b737..aceb496 100644 --- a/camel/providers/groupwise/ChangeLog +++ b/camel/providers/groupwise/ChangeLog @@ -1,3 +1,8 @@ +2006-06-09 Chris Heath + + * camel-groupwise-journal.c (update_cache): Fix memory leak. + Fixes bug #335423. + 2006-06-06 Jeffrey Stedfast Fixes for Novell bug #173454 diff --git a/camel/providers/groupwise/camel-groupwise-journal.c b/camel/providers/groupwise/camel-groupwise-journal.c index 9a0f7ac..cfbc8b5 100644 --- a/camel/providers/groupwise/camel-groupwise-journal.c +++ b/camel/providers/groupwise/camel-groupwise-journal.c @@ -372,6 +372,7 @@ update_cache (CamelGroupwiseJournal *groupwise_journal, CamelMimeMessage *messag camel_object_unref (cache); info = camel_folder_summary_info_new_from_message (folder->summary, message); + g_free(info->uid); info->uid = g_strdup (uid); gw_message_info_dup_to ((CamelMessageInfoBase *) info, (CamelMessageInfoBase *) mi); diff --git a/camel/providers/imap4/ChangeLog b/camel/providers/imap4/ChangeLog index 335901d..74744e5 100644 --- a/camel/providers/imap4/ChangeLog +++ b/camel/providers/imap4/ChangeLog @@ -1,3 +1,8 @@ +2006-06-09 Chris Heath + + * camel-imap4-journal.c (camel_imap4_journal_append): Fix memory leak. + Fixes bug #335423. + 2006-04-21 Jeffrey Stedfast * camel-imap4-store.c (connect_to_server): Set some socket options diff --git a/camel/providers/imap4/camel-imap4-journal.c b/camel/providers/imap4/camel-imap4-journal.c index b0bdd01..2dfcd22 100644 --- a/camel/providers/imap4/camel-imap4-journal.c +++ b/camel/providers/imap4/camel-imap4-journal.c @@ -351,6 +351,7 @@ camel_imap4_journal_append (CamelIMAP4Journal *imap4_journal, CamelMimeMessage * e_dlist_addtail (&journal->queue, (EDListNode *) entry); info = camel_folder_summary_info_new_from_message (folder->summary, message); + g_free(info->uid); info->uid = g_strdup (uid); imap4_message_info_dup_to ((CamelMessageInfoBase *) info, (CamelMessageInfoBase *) mi); diff --git a/camel/providers/local/ChangeLog b/camel/providers/local/ChangeLog index ba41fff..91ac721 100644 --- a/camel/providers/local/ChangeLog +++ b/camel/providers/local/ChangeLog @@ -1,3 +1,9 @@ +2006-06-09 Chris Heath + + * camel-local-summary.c (message_info_new_from_header): Fix memory leak + * camel-mbox-summary.c (message_info_new_from_header): Ditto. + Fixes bug #335423. + 2006-03-28 Jeffrey Stedfast * camel-mbox-summary.c (summary_update, mbox_summary_sync_full), diff --git a/camel/providers/local/camel-local-summary.c b/camel/providers/local/camel-local-summary.c index 92835a9..93d2ec2 100644 --- a/camel/providers/local/camel-local-summary.c +++ b/camel/providers/local/camel-local-summary.c @@ -633,6 +633,7 @@ message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h) if (xev==NULL || camel_local_summary_decode_x_evolution(cls, xev, mi) == -1) { /* to indicate it has no xev header */ mi->info.flags |= CAMEL_MESSAGE_FOLDER_FLAGGED | CAMEL_MESSAGE_FOLDER_NOXEV; + g_free (mi->info.uid); mi->info.uid = camel_folder_summary_next_uid_string(s); /* shortcut, no need to look it up in the index library */ diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c index 78b32c1..9557a25 100644 --- a/camel/providers/local/camel-mbox-summary.c +++ b/camel/providers/local/camel-mbox-summary.c @@ -319,6 +319,7 @@ message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h) if (add&1) { mi->info.info.flags |= CAMEL_MESSAGE_FOLDER_FLAGGED | CAMEL_MESSAGE_FOLDER_NOXEV; + g_free (mi->info.info.uid); mi->info.info.uid = camel_folder_summary_next_uid_string(s); } else { camel_folder_summary_set_uid(s, strtoul(camel_message_info_uid(mi), NULL, 10)); diff --git a/camel/providers/nntp/ChangeLog b/camel/providers/nntp/ChangeLog index c3f99fd..7023459 100644 --- a/camel/providers/nntp/ChangeLog +++ b/camel/providers/nntp/ChangeLog @@ -1,3 +1,8 @@ +2006-06-09 Chris Heath + + * camel-nntp-summary.c (message_info_new_from_header): Fix memory leak. + Fixes bug #335423. + 2005-12-13 Tor Lillqvist * camel-nntp-grouplist.c diff --git a/camel/providers/nntp/camel-nntp-summary.c b/camel/providers/nntp/camel-nntp-summary.c index 57c16a1..11589fe 100644 --- a/camel/providers/nntp/camel-nntp-summary.c +++ b/camel/providers/nntp/camel-nntp-summary.c @@ -150,7 +150,8 @@ message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h) mi = (CamelMessageInfoBase *)((CamelFolderSummaryClass *)camel_nntp_summary_parent)->message_info_new_from_header(s, h); if (mi) { - mi->uid = g_strdup(cns->priv->uid); + g_free(mi->uid); + mi->uid = cns->priv->uid; cns->priv->uid = NULL; } diff --git a/camel/providers/pop3/ChangeLog b/camel/providers/pop3/ChangeLog index 12a030f..961d2e2 100644 --- a/camel/providers/pop3/ChangeLog +++ b/camel/providers/pop3/ChangeLog @@ -1,3 +1,8 @@ +2006-06-09 Chris Heath + + * camel-pop3-engine.c (camel_pop3_engine_finalise): Fix memory leak. + Fixes bug #335423. + 2006-05-31 Jeffrey Stedfast * camel-pop3-store.c (connect_to_server): Fix a few of the TLS diff --git a/camel/providers/pop3/camel-pop3-engine.c b/camel/providers/pop3/camel-pop3-engine.c index bfd039c..0362100 100644 --- a/camel/providers/pop3/camel-pop3-engine.c +++ b/camel/providers/pop3/camel-pop3-engine.c @@ -74,6 +74,10 @@ camel_pop3_engine_finalise(CamelPOP3Engine *pe) if (pe->stream) camel_object_unref(pe->stream); + + g_list_free(pe->auth); + if (pe->apop) + g_free(pe->apop); } CamelType diff --git a/libedataserverui/ChangeLog b/libedataserverui/ChangeLog index 5c5b2ce..faa9376 100644 --- a/libedataserverui/ChangeLog +++ b/libedataserverui/ChangeLog @@ -1,3 +1,8 @@ +2006-06-09 Chris Heath + + * e-name-selector-dialog.c (search_changed): Fix memory leak. + Fixes bug #335423. + 2006-06-02 Hiroyuki Ikezoe ** Fixes bug 322239 diff --git a/libedataserverui/e-name-selector-dialog.c b/libedataserverui/e-name-selector-dialog.c index 448e134..0e56430 100644 --- a/libedataserverui/e-name-selector-dialog.c +++ b/libedataserverui/e-name-selector-dialog.c @@ -761,10 +761,9 @@ search_changed (ENameSelectorDialog *name_selector_dialog) category_option_menu = glade_xml_get_widget(name_selector_dialog->gui, "optionmenu-category"); category_id = gtk_option_menu_get_history (GTK_OPTION_MENU(category_option_menu)); category = g_list_nth_data (category_list, category_id); - category_escaped = escape_sexp_string (category); - if (!category) return; + category_escaped = escape_sexp_string (category); text = gtk_entry_get_text (name_selector_dialog->search_entry); text_escaped = escape_sexp_string (text); -- 2.7.4