From 65fad45129ffacacff81d6c976bef90442e9ef18 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 24 Dec 2001 10:31:11 +0000 Subject: [PATCH] bug in explode dn (caused most test failures when requesting client-side sorted results) --- libraries/libldap/getdn.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libraries/libldap/getdn.c b/libraries/libldap/getdn.c index 21980226d1..5c6f81f2b8 100644 --- a/libraries/libldap/getdn.c +++ b/libraries/libldap/getdn.c @@ -157,7 +157,7 @@ ldap_explode_dn( LDAP_CONST char *dn, int notypes ) ldap_rdn2str( tmpDN[ iRDN ][ 0 ], &str, flag ); - v = LDAP_REALLOC( values, sizeof( char * ) * ( iRDN + 1 ) ); + v = LDAP_REALLOC( values, sizeof( char * ) * ( 2 + iRDN ) ); if ( v == NULL ) { LBER_VFREE( values ); ldap_dnfree( tmpDN ); @@ -531,8 +531,10 @@ ldap_avafree( LDAPAVA *ava ) assert( ava ); #if 0 - /* ava's private must be freed by caller */ - assert( ava->la_private != NULL ); + /* ava's private must be freed by caller + * (at present let's skip this check because la_private + * basically holds static data) */ + assert( ava->la_private == NULL ); #endif ber_bvfree( ava->la_attr ); -- 2.39.5