From: Andrea Zagli <azagli@libero.it>
Date: Sun, 16 Dec 2012 10:37:27 +0000 (+0100)
Subject: Use the right function to set xml namespace in Atom.
X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=HEAD;p=libgfeed

Use the right function to set xml namespace in Atom.
---

diff --git a/src/atom.c b/src/atom.c
index f72aea3..d491795 100644
--- a/src/atom.c
+++ b/src/atom.c
@@ -265,11 +265,11 @@ xmlDoc
 	xmlDoc *xdoc = xmlNewDoc ((const xmlChar *)"1.0");
 	xmlNode *xroot = xmlNewNode (NULL, (const xmlChar *)"feed");
 
-  /* adding root element */
-  if (xroot == NULL) return NULL;
+	/* adding root element */
+	if (xroot == NULL) return NULL;
 
-  xmlSetProp (xroot, (const xmlChar *)"xmlns", (const xmlChar *)"http://www.w3.org/2005/Atom");
-  xmlDocSetRootElement (xdoc, xroot);
+	xmlNewNs (xroot, (const xmlChar *)"http://www.w3.org/2005/Atom", NULL);
+	xmlDocSetRootElement (xdoc, xroot);
 
 	lst = g_list_first (priv->author);
 	while (lst != NULL)
diff --git a/src/atomcommon.c b/src/atomcommon.c
index d906ba9..243a947 100644
--- a/src/atomcommon.c
+++ b/src/atomcommon.c
@@ -123,14 +123,12 @@ atom_common_get_xml (AtomCommon *atom_common, xmlNode *xnode)
 		{
 			xmlSetProp (xnode, (const xmlChar *)"xml:base", prop);
 		}
-	g_free (prop);
 
 	prop = (xmlChar *)g_strstrip (priv->lang);
 	if (!xmlStrEqual (prop, (const xmlChar *)""))
 		{
 			xmlSetProp (xnode, (const xmlChar *)"xml:lang", prop);
 		}
-	g_free (prop);
 }
 
 static void