From 931c4eb35f6177b899000b1f2e233341e1cfa4a5 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 3 May 2002 12:10:47 +0000 Subject: [PATCH] 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. --- libraries/libldap/cyrus.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } -- 2.39.5