]> git.0d.be Git - empathy.git/commitdiff
Build the right path when looking at user certs
authorCosimo Cecchi <cosimoc@gnome.org>
Fri, 13 Aug 2010 14:15:00 +0000 (16:15 +0200)
committerCosimo Cecchi <cosimoc@gnome.org>
Fri, 13 Aug 2010 14:22:25 +0000 (16:22 +0200)
libempathy/empathy-tls-verifier.c

index e85d8a750db5867d5062fe0fdab8980b82514d35..b71e54828d246c5b3a04f054c6a2b1abfc234894 100644 (file)
@@ -484,16 +484,18 @@ build_gnutls_ca_and_crl_lists (GIOSchedulerJob *job,
     }
   else
     {
-      const gchar *cert_path;
+      const gchar *cert_name;
 
-      while ((cert_path = g_dir_read_name (dir)) != NULL)
+      while ((cert_name = g_dir_read_name (dir)) != NULL)
         {
-          gchar *contents = NULL;
+          gchar *contents = NULL, *cert_path = NULL;
           gsize length = 0;
           gint res;
           gnutls_datum_t datum = { NULL, 0 };
           gnutls_x509_crt_t cert;
 
+          cert_path = g_build_filename (user_certs_dir, cert_name, NULL);
+
           g_file_get_contents (cert_path, &contents, &length, &error);
 
           if (error != NULL)
@@ -502,6 +504,7 @@ build_gnutls_ca_and_crl_lists (GIOSchedulerJob *job,
                   cert_path, error->message);
 
               g_clear_error (&error);
+              g_free (cert_path);
               continue;
             }
 
@@ -522,6 +525,7 @@ build_gnutls_ca_and_crl_lists (GIOSchedulerJob *job,
             }
 
           g_free (contents);
+          g_free (cert_path);
         }
 
       g_dir_close (dir);