[epiphany/wip/ephy-sync: 86/126] sync-service: Free SoupURI



commit 96c8709ef6726caaf845a0f83e4d2ab5833e9aaa
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date:   Thu Jul 28 22:38:02 2016 +0300

    sync-service: Free SoupURI

 src/ephy-sync-service.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/ephy-sync-service.c b/src/ephy-sync-service.c
index 95ccd77..ede69c0 100644
--- a/src/ephy-sync-service.c
+++ b/src/ephy-sync-service.c
@@ -390,6 +390,7 @@ static gboolean
 ephy_sync_service_certificate_is_valid (EphySyncService *self,
                                         const gchar     *certificate)
 {
+  SoupURI *uri;
   JsonParser *parser;
   JsonObject *json;
   JsonObject *principal;
@@ -405,6 +406,7 @@ ephy_sync_service_certificate_is_valid (EphySyncService *self,
 
   g_return_val_if_fail (certificate != NULL, FALSE);
 
+  uri = soup_uri_new (MOZILLA_FIREFOX_ACCOUNTS_BASE_URL);
   pieces = g_strsplit (certificate, ".", 0);
   header = (gchar *) base64_parse (pieces[0], &header_len);
   payload = (gchar *) base64_parse (pieces[1], &payload_len);
@@ -425,7 +427,7 @@ ephy_sync_service_certificate_is_valid (EphySyncService *self,
   email = json_object_get_string_member (principal, "email");
   uid_email = g_strdup_printf ("%s@%s",
                                self->uid,
-                               soup_uri_get_host (soup_uri_new (MOZILLA_FIREFOX_ACCOUNTS_BASE_URL)));
+                               soup_uri_get_host (uri));
 
   if (g_str_equal (uid_email, email) == FALSE) {
     g_warning ("Expected email %s, found %s. Giving up.", uid_email, email);
@@ -441,6 +443,7 @@ out:
   g_free (uid_email);
   g_strfreev (pieces);
   g_object_unref (parser);
+  soup_uri_free (uri);
 
   return retval;
 }


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