X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=libraries%2Flibldap%2Ffriendly.c;h=5d4abdabbe22cd60700352bcbbd3ca7b11095c03;hb=f42966f9e1ac239213e236b93375559a1e25ba5f;hp=9c7b966844dd0d777d9fbb9ea5f73f39b81a33c0;hpb=dc07e765f263ef459dcd2afd1ece01cfc85a0edd;p=openldap diff --git a/libraries/libldap/friendly.c b/libraries/libldap/friendly.c index 9c7b966844..5d4abdabbe 100644 --- a/libraries/libldap/friendly.c +++ b/libraries/libldap/friendly.c @@ -1,5 +1,6 @@ +/* $OpenLDAP$ */ /* - * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ /* Portions @@ -12,9 +13,8 @@ #include "portable.h" #include -#include +#include -#include #include #include #include @@ -49,7 +49,7 @@ ldap_friendly_name( } rewind( fp ); - if ( (*map = (LDAPFriendlyMap *) malloc( (entries + 1) * + if ( (*map = (LDAPFriendlyMap *) LDAP_MALLOC( (entries + 1) * sizeof(LDAPFriendlyMap) )) == NULL ) { fclose( fp ); return( uname ); @@ -86,8 +86,8 @@ ldap_friendly_name( } } - (*map)[i].lf_unfriendly = strdup( buf ); - (*map)[i].lf_friendly = strdup( s ); + (*map)[i].lf_unfriendly = LDAP_STRDUP( buf ); + (*map)[i].lf_friendly = LDAP_STRDUP( s ); i++; } @@ -113,10 +113,10 @@ ldap_free_friendlymap( LDAPFriendlyMap **map ) while ( pF->lf_unfriendly ) { - free( pF->lf_unfriendly ); - free( pF->lf_friendly ); + LDAP_FREE( pF->lf_unfriendly ); + LDAP_FREE( pF->lf_friendly ); pF++; } - free( *map ); + LDAP_FREE( *map ); *map = NULL; }