diff options
author | Chris Toshok <toshok@ximian.com> | 2001-08-14 12:16:13 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2001-08-14 12:16:13 +0800 |
commit | 7d17af894b3e2663c4d32405af0949bc34b24a8f (patch) | |
tree | c37d5648e67f8ed9e75727928fcf51ebf5d589b6 /addressbook | |
parent | 137c498c87c04a4488ffceef033fd4fd9e91869f (diff) | |
download | gsoc2013-evolution-7d17af894b3e2663c4d32405af0949bc34b24a8f.tar.gz gsoc2013-evolution-7d17af894b3e2663c4d32405af0949bc34b24a8f.tar.zst gsoc2013-evolution-7d17af894b3e2663c4d32405af0949bc34b24a8f.zip |
don't g_strdup the stuff we're passing into e_list_append, since it does
2001-08-13 Chris Toshok <toshok@ximian.com>
* backend/pas/pas-backend-ldap.c (add_to_supported_fields): don't
g_strdup the stuff we're passing into e_list_append, since it does
the copy for us.
(check_schema_support): don't initialize supported_fields list
here, since there's a gross case where the programmer/user can
bring up the contact editor before the connection stuff is
finished, and we don't want to crash.
(pas_backend_ldap_init): move it here to we can guarantee it's
there. (bug #6546).
svn path=/trunk/; revision=11989
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/backend/pas/pas-backend-ldap.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c index 804012d983..2d726483a7 100644 --- a/addressbook/backend/pas/pas-backend-ldap.c +++ b/addressbook/backend/pas/pas-backend-ldap.c @@ -289,18 +289,18 @@ add_to_supported_fields (PASBackendLDAP *bl, char **attrs, GHashTable *attr_hash char *query_prop = g_hash_table_lookup (attr_hash, attrs[i]); if (query_prop) { - e_list_append (bl->priv->supported_fields, g_strdup(query_prop)); + e_list_append (bl->priv->supported_fields, query_prop); /* handle the list attributes here */ if (!strcmp (query_prop, "email")) { - e_list_append (bl->priv->supported_fields, g_strdup("email_2")); - e_list_append (bl->priv->supported_fields, g_strdup("email_3")); + e_list_append (bl->priv->supported_fields, "email_2"); + e_list_append (bl->priv->supported_fields, "email_3"); } else if (!strcmp (query_prop, "business_phone")) { - e_list_append (bl->priv->supported_fields, g_strdup("business_phone_2")); + e_list_append (bl->priv->supported_fields, "business_phone_2"); } else if (!strcmp (query_prop, "home_phone")) { - e_list_append (bl->priv->supported_fields, g_strdup("home_phone_2")); + e_list_append (bl->priv->supported_fields, "home_phone_2"); } } } @@ -333,8 +333,6 @@ check_schema_support (PASBackendLDAP *bl) bl->priv->evolutionPersonChecked = TRUE; - bl->priv->supported_fields = e_list_new ((EListCopyFunc)g_strdup, (EListFreeFunc)g_free, NULL); - attrs[0] = "objectClasses"; attrs[1] = NULL; @@ -2420,7 +2418,9 @@ pas_backend_ldap_init (PASBackendLDAP *backend) { PASBackendLDAPPrivate *priv; - priv = g_new0 (PASBackendLDAPPrivate, 1); + priv = g_new0 (PASBackendLDAPPrivate, 1); + + priv->supported_fields = e_list_new ((EListCopyFunc)g_strdup, (EListFreeFunc)g_free, NULL); backend->priv = priv; } |