diff --git a/CHANGES b/CHANGES index 2e744f9406b35721c4f36122489973294298ff35..63a0f5f667655757cad0f8ea5431b528c9501a43 100644 --- a/CHANGES +++ b/CHANGES @@ -16,6 +16,7 @@ OpenLDAP 2.4.24 Engineering Fixed libldap GnuTLS hang on socket close (ITS#6673) Fixed libldap sasl partial write handling (ITS#6639) Fixed libldap referral chasing (ITS#6602) + Fixed libldap leak when chasing referrals (ITS#6744) Fixed libldap url parsing with NULL host (ITS#6653) Fixed liblutil getpass prompts (ITS#6702) Fixed ldapsearch segfault with deref (ITS#6638) diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 3fdf10d73b5e222e39556f9d6942285e5a816d4a..0f08ca2f66f72a5214698bcfc669ee93af4659b8 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -826,6 +826,7 @@ nextresp2: Debug( LDAP_DEBUG_TRACE, "read1msg: mark request completed, ld %p msgid %d\n", (void *)ld, lr->lr_msgid, 0); + tmplr = lr; while ( lr->lr_parent != NULL ) { merge_error_info( ld, lr->lr_parent, lr ); @@ -834,6 +835,12 @@ nextresp2: break; /* not completely done yet */ } } + /* ITS#6744: Original lr was refcounted when we retrieved it, + * must release it now that we're working with the parent + */ + if ( tmplr->lr_parent ) { + ldap_return_request( ld, tmplr, 0 ); + } /* Check if all requests are finished, lr is now parent */ tmplr = lr;