]> git.0d.be Git - empathy.git/commitdiff
Do not include accounts which don't have profile.. Also fix a leak.
authorXavier Claessens <xclaesse@src.gnome.org>
Fri, 17 Oct 2008 12:48:28 +0000 (12:48 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 17 Oct 2008 12:48:28 +0000 (12:48 +0000)
svn path=/trunk/; revision=1642

src/empathy-import-dialog.c

index c93555e81473977ba235d9d2db018504d474f47f..f8f27f1ceb9490d900d9e69145ff6d33e6da81ee 100644 (file)
@@ -293,9 +293,10 @@ import_dialog_pidgin_load (void)
           if (!tp_strdiff ((gchar *) child->name,
               PIDGIN_ACCOUNT_TAG_PROTOCOL))
             {
+              gchar *content;
               const gchar *protocol;
 
-              protocol = (gchar *) xmlNodeGetContent (child);
+              protocol = content = (gchar *) xmlNodeGetContent (child);
 
               if (g_str_has_prefix (protocol, "prpl-"))
                 protocol += 5;
@@ -306,6 +307,10 @@ import_dialog_pidgin_load (void)
                 protocol = "groupwise";
 
               data->profile = mc_profile_lookup (protocol);
+              g_free (content);
+
+              if (data->profile == NULL)
+                break;
             }
 
           /* Username and IRC server. */
@@ -376,7 +381,7 @@ import_dialog_pidgin_load (void)
 
       /* If we have the needed settings, add the account data to the list,
        * otherwise free the data */
-      if (g_hash_table_size (data->settings) > 0)
+      if (data->profile != NULL && g_hash_table_size (data->settings) > 0)
         accounts = g_list_prepend (accounts, data);
       else
         import_dialog_account_data_free (data);