From 91bba777e80f9c0ae0e482883967f258e0cd3fb9 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 30 Sep 2005 06:24:22 +0000 Subject: [PATCH] ITS#4048 from HEAD --- CHANGES | 2 +- libraries/libldap/cyrus.c | 34 +++++++++++++++++++--------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/CHANGES b/CHANGES index 6ecf1a5cea..73261408d5 100644 --- a/CHANGES +++ b/CHANGES @@ -7,7 +7,7 @@ OpenLDAP 2.2.29 Engineering Fixed back-bdb/hdb pointer/integer size warnings (ITS#4015) Fixed back-hdb slapcat EntryInfo cache growth (ITS#4010) Fixed liblber sb_dgram_read length (ITS#4046) - Fixed libldap unbind memory leaks (ITS#4052, 4053) + Fixed libldap memory leaks (ITS#4048, 4052, 4053) OpenLDAP 2.2.28 Release Fixed slapd ACL logging diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index c36fddd6c3..bbc4dfd076 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -719,17 +719,19 @@ ldap_int_sasl_bind( } if ( rc != LDAP_SUCCESS && rc != LDAP_SASL_BIND_IN_PROGRESS ) { - if( scred && scred->bv_len ) { - /* and server provided us with data? */ + if( scred ) { + if ( scred->bv_len ) { + /* and server provided us with data? */ #ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, DETAIL1, - "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", - rc, saslrc, scred->bv_len ); + LDAP_LOG ( TRANSPORT, DETAIL1, + "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", + rc, saslrc, scred->bv_len ); #else - Debug( LDAP_DEBUG_TRACE, - "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", - rc, saslrc, scred->bv_len ); + Debug( LDAP_DEBUG_TRACE, + "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", + rc, saslrc, scred->bv_len ); #endif + } ber_bvfree( scred ); } rc = ld->ld_errno; @@ -738,17 +740,19 @@ ldap_int_sasl_bind( if( rc == LDAP_SUCCESS && saslrc == SASL_OK ) { /* we're done, no need to step */ - if( scred && scred->bv_len ) { + if( scred ) { + if ( scred->bv_len ) { /* but server provided us with data! */ #ifdef NEW_LOGGING - LDAP_LOG ( TRANSPORT, DETAIL1, - "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", - rc, saslrc, scred->bv_len ); + LDAP_LOG ( TRANSPORT, DETAIL1, + "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", + rc, saslrc, scred->bv_len ); #else - Debug( LDAP_DEBUG_TRACE, - "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", - rc, saslrc, scred->bv_len ); + Debug( LDAP_DEBUG_TRACE, + "ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n", + rc, saslrc, scred->bv_len ); #endif + } ber_bvfree( scred ); rc = ld->ld_errno = LDAP_LOCAL_ERROR; goto done; -- 2.39.2