From c67d63acbaabca31297960e29725a9ef3224d327 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 9 Jun 2003 18:17:10 +0000 Subject: Fixes some leaks from bug #43883. 2003-06-06 Jeffrey Stedfast Fixes some leaks from bug #43883. * filter-file.c (xml_decode): Free file->path and set it to NULL before entering the loop to decode it. This way if the value is already set we don't leak it. Set file->path = g_strdup (str ? str : ""); and then xmlFree the str. 2003-05-21 Jeffrey Stedfast * filter-source.c (filter_source_get_sources): Same as below. * filter-label.c (xml_create): Unref the gconf client when we're finished with it. svn path=/trunk/; revision=21390 --- filter/ChangeLog | 15 +++++++++++++++ filter/filter-file.c | 9 +++++---- filter/filter-label.c | 2 ++ filter/filter-source.c | 8 ++++++-- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/filter/ChangeLog b/filter/ChangeLog index e69de29bb2..2a3a45a8fb 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -0,0 +1,15 @@ +2003-06-06 Jeffrey Stedfast + + Fixes some leaks from bug #43883. + + * filter-file.c (xml_decode): Free file->path and set it to + NULL before entering the loop to decode it. This way if the value + is already set we don't leak it. Set file->path = g_strdup (str ? + str : ""); and then xmlFree the str. + +2003-05-21 Jeffrey Stedfast + + * filter-source.c (filter_source_get_sources): Same as below. + + * filter-label.c (xml_create): Unref the gconf client when we're + finished with it. diff --git a/filter/filter-file.c b/filter/filter-file.c index 7d33e025d9..41c6b69c58 100644 --- a/filter/filter-file.c +++ b/filter/filter-file.c @@ -256,14 +256,15 @@ xml_decode (FilterElement *fe, xmlNodePtr node) xmlFree (file->type); file->type = type; + g_free (file->path); + file->path = NULL; + n = node->children; while (n != NULL) { if (!strcmp (n->name, type)) { str = xmlNodeGetContent (n); - if (str) - file->path = g_strdup (str); - else - file->path = g_strdup (""); + file->path = g_strdup (str ? str : ""); + xmlFree (str); d(printf (" '%s'\n", file->path)); break; diff --git a/filter/filter-label.c b/filter/filter-label.c index adf8557f57..2e8e8d787c 100644 --- a/filter/filter-label.c +++ b/filter/filter-label.c @@ -177,4 +177,6 @@ xml_create (FilterElement *fe, xmlNodePtr node) l = l->next; } g_slist_free (list); + + g_object_unref (gconf); } diff --git a/filter/filter-source.c b/filter/filter-source.c index 365403bdf2..a7713988ec 100644 --- a/filter/filter-source.c +++ b/filter/filter-source.c @@ -345,12 +345,16 @@ filter_source_get_sources (FilterSource *fs) { EAccountList *accounts; const EAccount *account; + GConfClient *gconf; EIterator *it; char *uri; CamelURL *url; - + /* should this get the global object from mail? */ - accounts = e_account_list_new(gconf_client_get_default()); + gconf = gconf_client_get_default (); + accounts = e_account_list_new (gconf); + g_object_unref (gconf); + for (it = e_list_get_iterator((EList *)accounts); e_iterator_is_valid(it); e_iterator_next(it)) { -- cgit v1.2.3