aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-06-10 02:17:10 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-06-10 02:17:10 +0800
commitc67d63acbaabca31297960e29725a9ef3224d327 (patch)
tree67092f1deb2cbc3dccdae747219c3930add5a507
parent0e8a7f2e737a6883dbe381437425043d0ec7f83b (diff)
downloadgsoc2013-evolution-c67d63acbaabca31297960e29725a9ef3224d327.tar
gsoc2013-evolution-c67d63acbaabca31297960e29725a9ef3224d327.tar.gz
gsoc2013-evolution-c67d63acbaabca31297960e29725a9ef3224d327.tar.bz2
gsoc2013-evolution-c67d63acbaabca31297960e29725a9ef3224d327.tar.lz
gsoc2013-evolution-c67d63acbaabca31297960e29725a9ef3224d327.tar.xz
gsoc2013-evolution-c67d63acbaabca31297960e29725a9ef3224d327.tar.zst
gsoc2013-evolution-c67d63acbaabca31297960e29725a9ef3224d327.zip
Fixes some leaks from bug #43883.
2003-06-06 Jeffrey Stedfast <fejj@ximian.com> 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 <fejj@ximian.com> * 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
-rw-r--r--filter/ChangeLog15
-rw-r--r--filter/filter-file.c9
-rw-r--r--filter/filter-label.c2
-rw-r--r--filter/filter-source.c8
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 <fejj@ximian.com>
+
+ 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 <fejj@ximian.com>
+
+ * 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)) {