according to sasl documentation, prompts is filled only if SASL_INTERACT is returned

This commit is contained in:
Pierangelo Masarati 2003-02-07 09:55:00 +00:00
parent f8a1007994
commit 6c32533d02

View file

@ -599,16 +599,19 @@ ldap_int_sasl_bind(
}
}
#if SASL_VERSION_MAJOR >= 2
/* XXX the application should free interact results. */
if ( prompts != NULL && prompts->result != NULL ) {
LDAP_FREE( (void *)prompts->result );
prompts->result = NULL;
}
#endif
if( saslrc == SASL_INTERACT ) {
int res;
#if SASL_VERSION_MAJOR >= 2
/* XXX the application should free interact results.
* FIXME: this should happen only
* if saslrc == SASL_INTERACT */
if ( prompts != NULL && prompts->result != NULL ) {
LDAP_FREE( (void *)prompts->result );
prompts->result = NULL;
}
#endif
if( !interact ) break;
res = (interact)( ld, flags, defaults, prompts );
if( res != LDAP_SUCCESS ) {