From: Howard Chu Date: Wed, 2 Jun 2010 03:10:39 +0000 (+0000) Subject: ITS#6568 plug cldap memleaks X-Git-Tag: MIGRATION_CVS2GIT~585 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d3a1be4e3fdfb4205ecfa9d4a4df0a220b4a1e3a;p=openldap ITS#6568 plug cldap memleaks --- diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index 2c1e787bdf..205599300a 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -124,10 +124,14 @@ ldap_send_initial_request( if (ld->ld_options.ldo_cldapdn) ldap_memfree(ld->ld_options.ldo_cldapdn); ld->ld_options.ldo_cldapdn = ldap_strdup(dn); + ber_free( ber, 1 ); return 0; } if (msgtype != LDAP_REQ_ABANDON && msgtype != LDAP_REQ_SEARCH) + { + ber_free( ber, 1 ); return LDAP_PARAM_ERROR; + } } #endif #ifdef LDAP_R_COMPILE diff --git a/libraries/libldap/unbind.c b/libraries/libldap/unbind.c index 15e6ee4f1b..bd4df7a849 100644 --- a/libraries/libldap/unbind.c +++ b/libraries/libldap/unbind.c @@ -154,6 +154,11 @@ ldap_ld_free( LDAP_FREE( ld->ld_options.ldo_peer ); ld->ld_options.ldo_peer = NULL; } + + if ( ld->ld_options.ldo_cldapdn != NULL ) { + LDAP_FREE( ld->ld_options.ldo_cldapdn ); + ld->ld_options.ldo_cldapdn = NULL; + } #endif #ifdef HAVE_CYRUS_SASL