aboutsummaryrefslogtreecommitdiffstats
path: root/filter/filter-file.c
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 /filter/filter-file.c
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
Diffstat (limited to 'filter/filter-file.c')
-rw-r--r--filter/filter-file.c9
1 files changed, 5 insertions, 4 deletions
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;