aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/pas
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/backend/pas')
-rw-r--r--addressbook/backend/pas/pas-backend-ldap.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c
index e1312ee5b9..056e56f28f 100644
--- a/addressbook/backend/pas/pas-backend-ldap.c
+++ b/addressbook/backend/pas/pas-backend-ldap.c
@@ -1552,7 +1552,7 @@ func_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
match_str = g_strdup_printf("=*%s%s)",
str, one_star ? "" : "*");
- query_length = strlen (header);
+ query_length = strlen (header) + strlen (footer);
for (i = 0; i < num_prop_infos; i ++) {
query_length += 1 + strlen(prop_info[i].ldap_attr) + strlen (match_str);
@@ -1727,13 +1727,19 @@ pas_backend_ldap_build_query (gchar *query)
e_sexp_result_free(sexp, r);
e_sexp_unref (sexp);
- if (list->next) {
- g_warning ("conversion to ldap query string failed");
- retval = NULL;
- g_list_foreach (list, (GFunc)g_free, NULL);
+ if (list) {
+ if (list->next) {
+ g_warning ("conversion to ldap query string failed");
+ retval = NULL;
+ g_list_foreach (list, (GFunc)g_free, NULL);
+ }
+ else {
+ retval = list->data;
+ }
}
else {
- retval = list->data;
+ g_warning ("conversion to ldap query string failed");
+ retval = NULL;
}
g_list_free (list);