From: Howard Chu Date: Fri, 3 May 2002 12:10:47 +0000 (+0000) Subject: For Cyrus 2, cannot free session_callbacks in ldap_int_sasl_open, must X-Git-Tag: OPENLDAP_REL_ENG_2_MP~109 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=931c4eb35f6177b899000b1f2e233341e1cfa4a5;p=openldap For Cyrus 2, cannot free session_callbacks in ldap_int_sasl_open, must wait until ldap_int_sasl_close because SASL doesn't copy our structure, it uses it directly. --- diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index 6aa10edfab..89492c6fff 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -455,8 +455,8 @@ ldap_int_sasl_open( #else rc = sasl_client_new( "ldap", host, session_callbacks, SASL_SECURITY_LAYER, &ctx ); -#endif LDAP_FREE( session_callbacks ); +#endif if ( rc != SASL_OK ) { ld->ld_errno = sasl_err2ldap( rc ); @@ -502,6 +502,11 @@ int ldap_int_sasl_close( LDAP *ld, LDAPConn *lc ) sasl_conn_t *ctx = lc->lconn_sasl_ctx; if( ctx != NULL ) { +#if SASL_VERSION_MAJOR >= 2 + const void *callbacks; + sasl_getprop( ctx, SASL_CALLBACK, &callbacks ); + LDAP_FREE( (void *)callbacks ); +#endif sasl_dispose( &ctx ); lc->lconn_sasl_ctx = NULL; }