From 576c5d0e7560c4ae9944677c04952ca1d6ecfa0f Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sun, 25 Jan 2004 16:35:01 +0000 Subject: Fix mem leak. 2004-01-25 Christian Persch * src/bookmarks/ephy-bookmarks-export.c: (ephy_bookmarks_export_rdf): Fix mem leak. --- src/bookmarks/ephy-bookmarks-export.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/bookmarks/ephy-bookmarks-export.c') diff --git a/src/bookmarks/ephy-bookmarks-export.c b/src/bookmarks/ephy-bookmarks-export.c index 42bc28783..df7537abf 100644 --- a/src/bookmarks/ephy-bookmarks-export.c +++ b/src/bookmarks/ephy-bookmarks-export.c @@ -150,6 +150,9 @@ ephy_bookmarks_export_rdf (EphyBookmarks *bookmarks, kid = g_ptr_array_index (children, i); + ret = xmlTextWriterStartElementNS (writer, "rdf", "li", NULL); + if (ret < 0) break; + smart_url = ephy_node_has_child (smart_bmks, kid); url = ephy_node_get_property_string (kid, EPHY_NODE_BMK_PROP_LOCATION); @@ -170,16 +173,9 @@ ephy_bookmarks_export_rdf (EphyBookmarks *bookmarks, } } - if (link == NULL) - { - link = g_strdup (url); - } - - ret = xmlTextWriterStartElementNS (writer, "rdf", "li", NULL); - if (ret < 0) break; - ret = xmlTextWriterWriteAttributeNS - (writer, "rdf", "about", NULL, link); + (writer, "rdf", "about", NULL, link ? link : url); + g_free (link); if (ret < 0) break; ret = xmlTextWriterEndElement (writer); /* rdf:li */ -- cgit v1.2.3