improve previous commit

This commit is contained in:
Pierangelo Masarati 2006-06-15 01:47:39 +00:00
parent 8b76e15d28
commit 8f1c5c4df5

View file

@ -700,8 +700,9 @@ struct berval *
ber_bvreplace_x( struct berval *dst, LDAP_CONST struct berval *src, void *ctx )
{
assert( dst != NULL );
assert( !BER_BVISNULL( src ) );
if ( dst->bv_len == 0 || dst->bv_len < src->bv_len ) {
if ( BER_BVISNULL( dst ) || dst->bv_len < src->bv_len ) {
dst->bv_val = ber_memrealloc_x( dst->bv_val, src->bv_len + 1, ctx );
}