From 6c32533d02d0f5b768e46a2dcb41e8e55dd57051 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 7 Feb 2003 09:55:00 +0000 Subject: [PATCH] according to sasl documentation, prompts is filled only if SASL_INTERACT is returned --- libraries/libldap/cyrus.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index c03d5464ad..08176f01ed 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -599,16 +599,19 @@ ldap_int_sasl_bind( } } + if( saslrc == SASL_INTERACT ) { + int res; + #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; - } + /* 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( saslrc == SASL_INTERACT ) { - int res; if( !interact ) break; res = (interact)( ld, flags, defaults, prompts ); if( res != LDAP_SUCCESS ) { -- 2.39.5