diff options
Diffstat (limited to 'shell/e-local-folder.c')
-rw-r--r-- | shell/e-local-folder.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/shell/e-local-folder.c b/shell/e-local-folder.c index 406341e793..b164eb1e95 100644 --- a/shell/e-local-folder.c +++ b/shell/e-local-folder.c @@ -39,6 +39,7 @@ #endif #include <gnome-xml/parser.h> +#include <gnome-xml/xmlmemory.h> #include "e-util/e-util.h" #include "e-util/e-xml-utils.h" @@ -56,11 +57,13 @@ static EFolderClass *parent_class = NULL; #define METADATA_FILE_NAME_LEN 19 -static const char * +static char * get_string_value (xmlNode *node, const char *name) { xmlNode *p; + xmlChar *xml_string; + char *retval; p = e_xml_get_child_by_name (node, (xmlChar *) name); if (p == NULL) @@ -70,7 +73,11 @@ get_string_value (xmlNode *node, if (p == NULL) return NULL; - return (const char *) xmlNodeListGetString (node->doc, p, 1); + xml_string = xmlNodeListGetString (node->doc, p, 1); + retval = g_strdup ((char *) xml_string); + xmlFree (xml_string); + + return retval; } static gboolean @@ -80,8 +87,8 @@ construct_loading_metadata (ELocalFolder *local_folder, EFolder *folder; xmlDoc *doc; xmlNode *root; - const char *type; - const char *description; + char *type; + char *description; char *metadata_path; folder = E_FOLDER (local_folder); @@ -106,6 +113,9 @@ construct_loading_metadata (ELocalFolder *local_folder, e_folder_construct (folder, g_basename (path), type, description); + g_free (type); + g_free (description); + xmlFreeDoc (doc); local_folder->physical_uri = g_strconcat (URI_PREFIX, path, NULL); |