dn = argv[optind++];
}
if (argc - optind > 0) {
- cred.bv_val = argv[optind++];
+ cred.bv_val = strdup(argv[optind++]);
cred.bv_len = strlen(cred.bv_val);
}
if (argc - optind > 0) {
}
skip:
- if ( verbose || ( code != LDAP_SUCCESS ) ||
- matcheddn || text || refs || ctrls )
+ if ( verbose || code != LDAP_SUCCESS ||
+ ( matcheddn && *matcheddn ) || ( text && *text ) || refs || ctrls )
{
printf( _("Result: %s (%d)\n"), ldap_err2string( code ), code );
ber_bvfree( scookie );
ber_bvfree( scred );
ber_memfree( diag );
+ free( cred.bv_val );
/* disconnect from server */
tool_unbind( ld );