aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/pas
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-06-16 07:05:35 +0800
committerChris Toshok <toshok@src.gnome.org>2002-06-16 07:05:35 +0800
commit50bf7290e804bd34f5780bf70276fa225fa000e2 (patch)
treecc05592ed7d57555d230776cfd29b94c11418eb5 /addressbook/backend/pas
parent9ad7232a43e90b775d2bc4510b2b0829c978bd57 (diff)
downloadgsoc2013-evolution-50bf7290e804bd34f5780bf70276fa225fa000e2.tar.gz
gsoc2013-evolution-50bf7290e804bd34f5780bf70276fa225fa000e2.tar.zst
gsoc2013-evolution-50bf7290e804bd34f5780bf70276fa225fa000e2.zip
use ldap_unbind_ext. (create_card_handler): don't leak the new vcard.
2002-06-15 Chris Toshok <toshok@ximian.com> * backend/pas/pas-backend-ldap.c (pas_backend_ldap_connect): use ldap_unbind_ext. (create_card_handler): don't leak the new vcard. (pas_backend_ldap_process_authenticate_user): don't leak the dn. svn path=/trunk/; revision=17197
Diffstat (limited to 'addressbook/backend/pas')
-rw-r--r--addressbook/backend/pas/pas-backend-ldap.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c
index ee41bfcb69..ceedc1419f 100644
--- a/addressbook/backend/pas/pas-backend-ldap.c
+++ b/addressbook/backend/pas/pas-backend-ldap.c
@@ -552,7 +552,7 @@ pas_backend_ldap_connect (PASBackendLDAP *bl)
/* close connection first if it's open first */
if (blpriv->ldap)
- ldap_unbind (blpriv->ldap);
+ ldap_unbind_ext (blpriv->ldap, NULL, NULL);
blpriv->ldap = ldap_init (blpriv->ldap_host, blpriv->ldap_port);
#if defined (DEBUG) && defined (LDAP_OPT_DEBUG_LEVEL)
@@ -980,21 +980,24 @@ create_card_handler (LDAPOp *op, LDAPMessage *res)
CORBA_Environment ev;
gboolean match;
PASBackendLDAPBookView *view = l->data;
+ char *new_vcard;
CORBA_exception_init(&ev);
bonobo_object_dup_ref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
+ new_vcard = e_card_simple_get_vcard_assume_utf8 (create_op->new_card);
+
match = pas_backend_card_sexp_match_vcard (view->card_sexp,
- e_card_simple_get_vcard_assume_utf8 (create_op->new_card));
+ new_vcard);
if (match) {
- char *vcard = e_card_simple_get_vcard_assume_utf8 (create_op->new_card);
pas_book_view_notify_add_1 (view->book_view,
- vcard);
- g_free (vcard);
+ new_vcard);
}
pas_book_view_notify_complete (view->book_view);
+ g_free (new_vcard);
+
bonobo_object_release_unref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
}
}
@@ -2853,8 +2856,14 @@ pas_backend_ldap_process_authenticate_user (PASBackend *backend,
g_free (query);
if (ldap_error == LDAP_SUCCESS) {
+ char *entry_dn;
+
e = ldap_first_entry (bl->priv->ldap, res);
- dn = g_strdup(ldap_get_dn (bl->priv->ldap, e));
+
+ entry_dn = ldap_get_dn (bl->priv->ldap, e);
+ dn = g_strdup(entry_dn);
+
+ ldap_memfree (entry_dn);
ldap_msgfree (res);
}
else {