- if( ld == NULL ) {
- fprintf( stderr, "Could not create LDAP session handle (%d): %s\n",
- rc, ldap_err2string(rc) );
- return EXIT_FAILURE;
+ rc = ldap_initialize( &ld, ldapuri );
+ if( rc != LDAP_SUCCESS ) {
+ fprintf( stderr, "Could not create LDAP session handle (%d): %s\n",
+ rc, ldap_err2string(rc) );
+ return EXIT_FAILURE;
+ }