From 913da6cfdf0a1e636bf201b7c18aa28dce420db3 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Thu, 27 Nov 2008 02:27:26 -0200 Subject: [PATCH] When parsing an entry, create a new ID object and copy the others When parsing the entry, the strings were not copied and the ID was a string and not an ID object. --- atom/entry.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/atom/entry.c b/atom/entry.c index 99ab439..c7c2b0a 100644 --- a/atom/entry.c +++ b/atom/entry.c @@ -75,15 +75,15 @@ atom_entry_new_data_len (char *data, size_t len) char * content; content = xmlNodeGetContent (child->xmlChildrenNode); if (!xmlStrcmp (child->name, "id")) - entry->id = content; + entry->id = atom_id_new (content); else if (!xmlStrcmp (child->name, "title")) - entry->title = content; + entry->title = g_strdup (content); else if (!xmlStrcmp (child->name, "summary")) - entry->summary = content; + entry->summary = g_strdup (content); else if (!xmlStrcmp (child->name, "author")) - atom_entry_author_add (entry, atom_person_new_from_xmlnode (child)); + atom_entry_author_add (entry, atom_person_new_from_xmlnode (child)); else - xmlFree (content); + xmlFree (content); } return entry; } @@ -94,7 +94,7 @@ atom_entry_delete (AtomEntry *entry) if (entry->doc) xmlFreeDoc (entry->doc); if (entry->id) - g_free (entry->id); + atom_id_delete (entry->id); if (entry->title) g_free (entry->title); if (entry->authors) -- 2.20.1