]> git.sur5r.net Git - openldap/commitdiff
For Cyrus 2, cannot free session_callbacks in ldap_int_sasl_open, must
authorHoward Chu <hyc@openldap.org>
Fri, 3 May 2002 12:10:47 +0000 (12:10 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 3 May 2002 12:10:47 +0000 (12:10 +0000)
wait until ldap_int_sasl_close because SASL doesn't copy our structure,
it uses it directly.

libraries/libldap/cyrus.c

index 6aa10edfab95dda73727518c358971f589e451c4..89492c6fff8238d807e71720d767ee24c6499771 100644 (file)
@@ -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;
        }