From 7b900b07c7aca6b466d59961c655c6f7d547af1b Mon Sep 17 00:00:00 2001 From: Quanah Gibson-Mount Date: Thu, 5 Mar 2009 20:07:20 +0000 Subject: [PATCH] ITS#5980 --- CHANGES | 1 + libraries/libldap/request.c | 3 +-- libraries/libldap/result.c | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index b15f903c4f..5dea086db6 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,7 @@ OpenLDAP 2.4.16 Engineering Fixed libldap GnuTLS TLSVerifyCilent try (ITS#5981) Fixed libldap segfault in checking cert/DN (ITS#5976) Fixed libldap peer cert memory leak again (ITS#5849) + Fixed libldap referral chasing (ITS#5980) Fixed slapd backglue with empty DBs (ITS#5986) Fixed slapd-bdb/hdb cachesize handling (ITS#5860) Fixed slapd-ldap/meta with broken AD results (ITS#5977) diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index 0fdf5c9794..6098f0c904 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -635,8 +635,7 @@ find_connection( LDAP *ld, LDAPURLDesc *srv, int any ) if ( lsu_port == lcu_port && strcmp( lcu->lud_scheme, lsu->lud_scheme ) == 0 - && lcu->lud_host != NULL && *lcu->lud_host != '\0' - && lsu->lud_host != NULL && *lsu->lud_host != '\0' + && lcu->lud_host != NULL && lsu->lud_host != NULL && strcasecmp( lsu->lud_host, lcu->lud_host ) == 0 ) { found = 1; diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index ad62a02d30..afdc236ea7 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -845,6 +845,10 @@ nextresp2: return( -1 ); /* fatal error */ } lr->lr_res_errno = LDAP_SUCCESS; /* sucessfully chased referral */ + if ( lr->lr_res_matched ) { + LDAP_FREE( lr->lr_res_matched ); + lr->lr_res_matched = NULL; + } } else { if ( lr->lr_outrefcnt <= 0 && lr->lr_parent == NULL ) { -- 2.39.5