diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index b892accecd..59d5b41cf7 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -82,7 +82,8 @@ int ldap_int_sasl_init( void ) return 0; } -#ifndef CSRIMALLOC +/* SASL 2 takes care of its own memory completely internally */ +#if SASL_VERSION_MAJOR < 2 && !defined(CSRIMALLOC) sasl_set_alloc( ber_memalloc, ber_memcalloc, diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index 6db5f1dc3c..3430d4ee68 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -1114,12 +1114,15 @@ int slap_sasl_init( void ) return -1; } #endif - + + /* SASL 2 does its own memory management internally */ +#if SASL_VERSION_MAJOR < 2 sasl_set_alloc( ber_memalloc, ber_memcalloc, ber_memrealloc, ber_memfree ); +#endif sasl_set_mutex( ldap_pvt_sasl_mutex_new,