Debug( LDAP_DEBUG_TRACE, "ldap_first_attribute\n", 0, 0, 0 );
if ( (*ber = ldap_alloc_ber_with_options( ld )) == NULLBER ) {
+ *ber = NULL;
return( NULL );
}
== LBER_ERROR ) {
ld->ld_errno = LDAP_DECODING_ERROR;
ber_free( *ber, 0 );
+ *ber = NULL;
return( NULL );
}
if ( ber_scanf( ber, "{sx}", ld->ld_attrbuffer, &len )
== LBER_ERROR ) {
ld->ld_errno = LDAP_DECODING_ERROR;
- ber_free( ber, 0 );
+ /* ber_free( ber, 0 ); *//* don't free the BerElement */
return( NULL );
}