{
struct ldapoptions *lo;
- /* Get pointer to global option structure */
- lo = LDAP_INT_GLOBAL_OPT();
- if (NULL == lo) {
- return LDAP_NO_MEMORY;
- }
-
- if(ld != NULL) {
+ if( ld != NULL ) {
assert( LDAP_VALID( ld ) );
if( !LDAP_VALID( ld ) ) {
}
lo = &ld->ld_options;
+
+ } else {
+ /* Get pointer to global option structure */
+ lo = LDAP_INT_GLOBAL_OPT();
+ if ( lo == NULL ) {
+ return LDAP_NO_MEMORY;
+ }
}
switch( option ) {
{
struct ldapoptions *lo;
- /* Get pointer to global option structure */
- lo = LDAP_INT_GLOBAL_OPT();
- if (NULL == lo) {
- return LDAP_NO_MEMORY;
- }
-
- if(ld != NULL) {
+ if( ld != NULL ) {
assert( LDAP_VALID( ld ) );
if( !LDAP_VALID( ld ) ) {
}
lo = &ld->ld_options;
+
+ } else {
+ /* Get pointer to global option structure */
+ lo = LDAP_INT_GLOBAL_OPT();
+ if ( lo == NULL ) {
+ return LDAP_NO_MEMORY;
+ }
}
switch( option ) {
return 0;
}
- if ( lo != NULL ) {
+ if ( ld != NULL ) {
return -1;
}