(LDAP_seq): try handling errors better

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14031 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2004-07-08 14:29:20 +00:00
parent d6e16be502
commit 255b3f04e7

View File

@@ -1316,6 +1316,10 @@ LDAP_seq(krb5_context context, HDB * db, unsigned flags, hdb_entry * entry)
do { do {
rc = ldap_result(HDB2LDAP(db), msgid, LDAP_MSG_ONE, NULL, &e); rc = ldap_result(HDB2LDAP(db), msgid, LDAP_MSG_ONE, NULL, &e);
switch (rc) { switch (rc) {
case LDAP_RES_SEARCH_REFERENCE:
ldap_msgfree(e);
ret = 0;
break;
case LDAP_RES_SEARCH_ENTRY: case LDAP_RES_SEARCH_ENTRY:
/* We have an entry. Parse it. */ /* We have an entry. Parse it. */
ret = LDAP_message2entry(context, db, e, entry); ret = LDAP_message2entry(context, db, e, entry);
@@ -1336,10 +1340,11 @@ LDAP_seq(krb5_context context, HDB * db, unsigned flags, hdb_entry * entry)
HDBSETMSGID(db, -1); HDBSETMSGID(db, -1);
break; break;
case LDAP_SERVER_DOWN: case LDAP_SERVER_DOWN:
ldap_msgfree(e);
LDAP_close(context, db); LDAP_close(context, db);
/* fall though */ HDBSETMSGID(db, -1);
case 0: ret = ENETDOWN;
case -1: break;
default: default:
/* Some unspecified error (timeout?). Abandon. */ /* Some unspecified error (timeout?). Abandon. */
ldap_msgfree(e); ldap_msgfree(e);