Use free instead of ber_bvecfree to free privately malloced data, by JR Heisey

This commit is contained in:
Hallvard Furuseth 1999-03-09 05:56:13 +00:00
parent ce9d86a278
commit 95f6547963

View File

@ -758,6 +758,32 @@ domodrdn( char *dn, char *newrdn, int deleteoldrdn )
// for Windows we need local versions of the berval
// free functions because the LDAP DLL uses a different
// heap.
static void
l_ber_bvfree( struct berval *bv )
{
if ( bv != NULL ) {
if ( bv->bv_val != NULL ) {
free( bv->bv_val );
}
free( (char *) bv );
}
}
static void
l_ber_bvecfree( struct berval **bv )
{
int i;
for ( i = 0; bv[i] != NULL; i++ ) {
l_ber_bvfree( bv[i] );
}
free( (char *) bv );
}
static void
freepmods( LDAPMod **pmods )
{
@ -765,7 +791,7 @@ freepmods( LDAPMod **pmods )
for ( i = 0; pmods[ i ] != NULL; ++i ) {
if ( pmods[ i ]->mod_bvalues != NULL ) {
ber_bvecfree( pmods[ i ]->mod_bvalues );
l_ber_bvecfree( pmods[ i ]->mod_bvalues );
}
if ( pmods[ i ]->mod_type != NULL ) {
free( pmods[ i ]->mod_type );