]> git.sur5r.net Git - openldap/commitdiff
according to sasl documentation, prompts is filled only if SASL_INTERACT is returned
authorPierangelo Masarati <ando@openldap.org>
Fri, 7 Feb 2003 09:55:00 +0000 (09:55 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 7 Feb 2003 09:55:00 +0000 (09:55 +0000)
libraries/libldap/cyrus.c

index c03d5464adb3ead007ca7ef54534b993f4dbc854..08176f01ed942d86f7549e0f3b3ee350602c4864 100644 (file)
@@ -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 ) {