From: Kurt Zeilenga Date: Tue, 6 Nov 2001 17:46:30 +0000 (+0000) Subject: Import memory leak plugs from HEAD X-Git-Tag: OPENLDAP_REL_ENG_2_0_19~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f09ba82cf4e464ce122bfc9fa208b8d6b91ad832;p=thirdparty%2Fopenldap.git Import memory leak plugs from HEAD --- diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index 59bf53c96b..442ffe34f2 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -418,6 +418,7 @@ ldap_int_sasl_open( rc = sasl_client_new( "ldap", host, session_callbacks, SASL_SECURITY_LAYER, &ctx ); + ber_memfree( session_callbacks ); if ( rc != SASL_OK ) { ld->ld_errno = sasl_err2ldap( rc ); diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index 950ccc8142..1e3cb78ca0 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -324,6 +324,7 @@ ldap_int_open_connection( #ifdef HAVE_CYRUS_SASL if( sasl_host != NULL ) { ldap_int_sasl_open( ld, conn, sasl_host, sasl_ssf ); + LDAP_FREE( sasl_host ); } #endif diff --git a/libraries/libldap/unbind.c b/libraries/libldap/unbind.c index 0699a4be0b..9dd5ea778f 100644 --- a/libraries/libldap/unbind.c +++ b/libraries/libldap/unbind.c @@ -128,6 +128,26 @@ ldap_ld_free( ld->ld_options.ldo_tm_net = NULL; } + if ( ld->ld_options.ldo_def_sasl_mech != NULL ) { + LDAP_FREE( ld->ld_options.ldo_def_sasl_mech ); + ld->ld_options.ldo_def_sasl_mech = NULL; + } + + if ( ld->ld_options.ldo_def_sasl_realm != NULL ) { + LDAP_FREE( ld->ld_options.ldo_def_sasl_realm ); + ld->ld_options.ldo_def_sasl_realm = NULL; + } + + if ( ld->ld_options.ldo_def_sasl_authcid != NULL ) { + LDAP_FREE( ld->ld_options.ldo_def_sasl_authcid ); + ld->ld_options.ldo_def_sasl_authcid = NULL; + } + + if ( ld->ld_options.ldo_def_sasl_authzid != NULL ) { + LDAP_FREE( ld->ld_options.ldo_def_sasl_authzid ); + ld->ld_options.ldo_def_sasl_authzid = NULL; + } + ber_sockbuf_free( ld->ld_sb ); LDAP_FREE( (char *) ld );