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
This commit is contained in:
Jeffrey Stedfast
2003-06-09 18:17:10 +00:00
committed by Jeffrey Stedfast
parent 0e8a7f2e73
commit c67d63acba
4 changed files with 28 additions and 6 deletions

View File

@ -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.

View File

@ -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;

View File

@ -177,4 +177,6 @@ xml_create (FilterElement *fe, xmlNodePtr node)
l = l->next;
}
g_slist_free (list);
g_object_unref (gconf);
}

View File

@ -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)) {