From 02048d1c08f3daa31e07c5681e81de2c918f4251 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 8 Aug 2001 16:32:42 +0000 Subject: don't mix g_free and xmlAlloc (xml_decode): don't mix g_free and xmlAlloc 2001-08-08 Radek Doulik * filter-folder.c (button_clicked): don't mix g_free and xmlAlloc (xml_decode): don't mix g_free and xmlAlloc * filter-code.c (filter_code_init): use xmlStrdup instead of g_strdup * filter-input.c (filter_input_new_type_name): use xmlStrdup instead of g_strdup (filter_input_finalise): don't mix g_free and xmlAlloc * filter-option.c (clone): use xmlStrdup instead of g_strdup (free_option): don't mix g_free and xmlAlloc svn path=/trunk/; revision=11795 --- filter/ChangeLog | 13 +++++++++++++ filter/filter-code.c | 2 +- filter/filter-folder.c | 15 +++++++++++---- filter/filter-input.c | 4 ++-- filter/filter-option.c | 4 ++-- 5 files changed, 29 insertions(+), 9 deletions(-) (limited to 'filter') diff --git a/filter/ChangeLog b/filter/ChangeLog index cbd2332adf..b8148bbf48 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,5 +1,18 @@ 2001-08-08 Radek Doulik + * filter-folder.c (button_clicked): don't mix g_free and xmlAlloc + (xml_decode): don't mix g_free and xmlAlloc + + * filter-code.c (filter_code_init): use xmlStrdup instead of + g_strdup + + * filter-input.c (filter_input_new_type_name): use xmlStrdup + instead of g_strdup + (filter_input_finalise): don't mix g_free and xmlAlloc + + * filter-option.c (clone): use xmlStrdup instead of g_strdup + (free_option): don't mix g_free and xmlAlloc + * filter-source.c (clone): use xmlStrdup rather than g_strdup * filter-element.c (filter_element_finalise): don't mix g_free and diff --git a/filter/filter-code.c b/filter/filter-code.c index ecdccc4b97..9ae83468f9 100644 --- a/filter/filter-code.c +++ b/filter/filter-code.c @@ -75,7 +75,7 @@ filter_code_class_init (FilterCodeClass *class) static void filter_code_init (FilterCode *o) { - ((FilterInput *)o)->type = g_strdup("code"); + ((FilterInput *)o)->type = xmlStrdup("code"); } static void diff --git a/filter/filter-folder.c b/filter/filter-folder.c index 4b43997c2b..c79059178e 100644 --- a/filter/filter-folder.c +++ b/filter/filter-folder.c @@ -193,10 +193,17 @@ xml_decode (FilterElement *fe, xmlNodePtr node) n = node->childs; while (n) { if (!strcmp (n->name, "folder")) { - xmlFree (ff->name); - xmlFree (ff->uri); - ff->name = xmlGetProp (n, "name"); - ff->uri = xmlGetProp (n, "uri"); + char *uri, *name; + + name = xmlGetProp (n, "name"); + g_free (ff->name); + ff->name = g_strdup (name); + xmlFree (name); + + uri = xmlGetProp (n, "uri"); + g_free (ff->uri); + ff->uri = g_strdup (uri); + xmlFree (uri); break; } n = n->next; diff --git a/filter/filter-input.c b/filter/filter-input.c index e25d3e40ee..8bf430993b 100644 --- a/filter/filter-input.c +++ b/filter/filter-input.c @@ -121,7 +121,7 @@ filter_input_finalise (GtkObject *obj) { FilterInput *o = (FilterInput *)obj; - g_free(o->type); + xmlFree (o->type); g_list_foreach(o->values, (GFunc)g_free, NULL); g_list_free(o->values); @@ -148,7 +148,7 @@ FilterInput * filter_input_new_type_name (const char *type) { FilterInput *o = filter_input_new (); - o->type = g_strdup (type); + o->type = xmlStrdup (type); d(printf("new type %s = %p\n", type, o)); return o; diff --git a/filter/filter-option.c b/filter/filter-option.c index 9648bc36a0..a517fd71df 100644 --- a/filter/filter-option.c +++ b/filter/filter-option.c @@ -116,7 +116,7 @@ static void free_option(struct _filter_option *o, void *data) { g_free(o->title); - g_free(o->value); + xmlFree (o->value); g_free(o->code); g_free(o); } @@ -343,7 +343,7 @@ clone (FilterElement *fe) fn = g_malloc (sizeof (*fn)); d(printf (" option %s\n", op->title)); fn->title = g_strdup (op->title); - fn->value = g_strdup (op->value); + fn->value = xmlStrdup (op->value); if (op->code) fn->code = g_strdup (op->code); else -- cgit v1.2.3