sasl_mech, NULL, NULL,
sasl_flags, lutil_sasl_interact, defaults );
+ lutil_sasl_freedefs( defaults );
if( rc != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_sasl_interactive_bind_s" );
exit( EXIT_FAILURE );
#endif
ldap_unbind( ld );
+ sasl_done();
+ ldap_pvt_tls_destroy();
return( rc );
}
}
done:
+ ldap_msgfree( res );
#ifdef LDAP_CONTROL_PAGEDRESULTS
if ( pageSize != 0 ) {
npagedresponses = npagedresponses + nresponses;
fprintf( stderr, "%s (%d)\n", ldap_err2string(err), err );
}
- if( matcheddn && *matcheddn ) {
+ if( matcheddn ) {
+ if( *matcheddn ) {
if( !ldif ) {
write_ldif( LDIF_PUT_VALUE,
"matchedDN", matcheddn, strlen(matcheddn) );
} else {
fprintf( stderr, "Matched DN: %s\n", matcheddn );
}
+ }
ber_memfree( matcheddn );
}
- if( text && *text ) {
+ if( text ) {
+ if( *text ) {
if( !ldif ) {
write_ldif( LDIF_PUT_TEXT, "text",
text, strlen(text) );
} else {
fprintf( stderr, "Additional information: %s\n", text );
}
+ }
ber_memfree( text );
}