-#ifndef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
- if ( ld->ld_sb.sb_ber.ber_buf != NULL )
- free( ld->ld_sb.sb_ber.ber_buf );
-#endif /* !LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
- if ( ld->ld_abandoned != NULL )
- free( ld->ld_abandoned );
-
-#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
- if ( ld->ld_selectinfo != NULL )
- ldap_free_select_info( ld->ld_selectinfo );
-#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */