[evolution-rss] Bug 587789 - Crash when importing .opml



commit bf74b1025b145913f27642309badaa894a8bd530
Author: Lucian Langa <lucilanga gnome org>
Date:   Sun Jul 5 16:44:05 2009 +0300

    Bug 587789 - Crash when importing .opml

 src/rss-config-factory.c |    2 ++
 src/rss.c                |    9 +++++----
 2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/rss-config-factory.c b/src/rss-config-factory.c
index e8d8359..efe8b08 100644
--- a/src/rss-config-factory.c
+++ b/src/rss-config-factory.c
@@ -1168,6 +1168,8 @@ iterate_import_file(xmlNode *src, gchar **url, xmlChar **title, guint type)
         	src = html_find(src, "outline");
         	*url = (gchar *)xmlGetProp(src, (xmlChar *)"xmlUrl");
 		*title = xmlGetProp(src, (xmlChar *)"title");
+		if (!(*title = xmlGetProp(src, (xmlChar *)"title")))
+			*title = xmlGetProp(src, (xmlChar *)"text");
 	} else if (type == 1) {
 		xmlNode *my;
 		src = html_find(src, "member");
diff --git a/src/rss.c b/src/rss.c
index df2d190..266d93a 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -2363,7 +2363,7 @@ generate_safe_chn_name(gchar *chn_name)
 		g_string_free (result, TRUE);
 		g_free(tmp);
 	}
-	return chn_name;
+	return g_strdup(chn_name);
 }
 
 gchar *
@@ -2404,7 +2404,7 @@ setup_feed(add_feed *feed)
         RDF *r = NULL;
         GString *post = NULL, *content = NULL;
         GError *err = NULL;
-	gchar *chn_name = NULL, *tmp_chn_name = NULL;
+	gchar *chn_name = NULL, *tmp_chn_name = NULL, *tmp = NULL;
 
 	check_folders();
 
@@ -2530,7 +2530,7 @@ add:
                 //FIXME g_free
 		tmp_chn_name = chn_name;
 		chn_name = sanitize_folder(chn_name);
-		g_free(chn_name);
+		tmp = chn_name;
                	chn_name = generate_safe_chn_name(chn_name);
 		
 		gpointer crc_feed = gen_md5(feed->feed_url);
@@ -2592,6 +2592,7 @@ add:
 		display_feed(r);
 
 		g_free(tmp_chn_name);
+		g_free(tmp);
 		g_free(chn_name);
 
 		if (r->cache)
@@ -4518,7 +4519,7 @@ finish_image (SoupMessage *msg, CamelStream *user_data)
 finish_image (SoupSession *soup_sess, SoupMessage *msg, CamelStream *user_data)
 #endif
 {
-	g_print("finish_image:%d\n", msg->status_code);
+	d(g_print("finish_image:%d\n", msg->status_code));
 	// we might need to handle more error codes here
 	if (503 != msg->status_code && //handle this timedly fasion
 	    404 != msg->status_code &&



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]