aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/publish-calendar/publish-location.c
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchen@src.gnome.org>2006-01-25 15:29:18 +0800
committerChenthill Palanisamy <pchen@src.gnome.org>2006-01-25 15:29:18 +0800
commitdbfb80ad80a6cdbf624582a8f154a12227b3459b (patch)
tree9399a52e57e9fa60810dbe733c3737de68541db5 /plugins/publish-calendar/publish-location.c
parent49477d1708a89e9fc2d939b54b894d69624e8d0f (diff)
downloadgsoc2013-evolution-dbfb80ad80a6cdbf624582a8f154a12227b3459b.tar.gz
gsoc2013-evolution-dbfb80ad80a6cdbf624582a8f154a12227b3459b.tar.zst
gsoc2013-evolution-dbfb80ad80a6cdbf624582a8f154a12227b3459b.zip
Fixes #328224, 328408, 328389
svn path=/trunk/; revision=31303
Diffstat (limited to 'plugins/publish-calendar/publish-location.c')
-rw-r--r--plugins/publish-calendar/publish-location.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/publish-calendar/publish-location.c b/plugins/publish-calendar/publish-location.c
index 4c2b36780b..fef67e7a08 100644
--- a/plugins/publish-calendar/publish-location.c
+++ b/plugins/publish-calendar/publish-location.c
@@ -60,6 +60,12 @@ migrateURI (const gchar *xml, xmlDocPtr doc)
username = xmlGetProp (root, "username");
vfs_uri = gnome_vfs_uri_new (location);
+
+ if (!vfs_uri) {
+ g_warning ("Could not form the uri for %s \n", location);
+ goto cleanup;
+ }
+
gnome_vfs_uri_set_user_name (vfs_uri, username);
temp = gnome_vfs_uri_to_string (vfs_uri, GNOME_VFS_URI_HIDE_TOPLEVEL_METHOD | GNOME_VFS_URI_HIDE_PASSWORD);
uri->location = g_strdup_printf ("dav://%s", temp);
@@ -95,9 +101,11 @@ migrateURI (const gchar *xml, xmlDocPtr doc)
g_slist_free (uris);
g_object_unref (client);
+cleanup:
xmlFree (location);
xmlFree (enabled);
xmlFree (frequency);
+ xmlFree (username);
xmlFreeDoc (doc);
return uri;
@@ -109,7 +117,7 @@ e_publish_uri_from_xml (const gchar *xml)
xmlDocPtr doc;
xmlNodePtr root, p;
xmlChar *location, *enabled, *frequency;
- xmlChar *publish_time, *format;
+ xmlChar *publish_time, *format, *username = NULL;
GSList *events = NULL;
EPublishUri *uri;
@@ -121,8 +129,11 @@ e_publish_uri_from_xml (const gchar *xml)
if (strcmp (root->name, "uri") != 0)
return NULL;
- if (xmlGetProp (root, "username"))
+ if ((username = xmlGetProp (root, "username"))) {
+ xmlFree (username);
return migrateURI (xml, doc);
+
+ }
uri = g_new0 (EPublishUri, 1);