From 02d668d8a83ccc3e11d0f3d65baa7ec2b7d4e85e Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Sun, 14 Mar 1999 07:40:45 +0000 Subject: [PATCH] free -> ldap_memfree. Remove spurious strdup. --- contrib/whois++/describe.c | 4 ++-- contrib/whois++/output.c | 8 ++++---- contrib/whois++/whois++.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib/whois++/describe.c b/contrib/whois++/describe.c index 94813d9370..1fb0e33a45 100644 --- a/contrib/whois++/describe.c +++ b/contrib/whois++/describe.c @@ -183,12 +183,12 @@ according to the IAFA services template." ); } else { #endif value = ldap_dn2ufn( ptr = ldap_get_dn( ld, result ) ); - free( ptr ); + ldap_memfree( ptr ); if ( (ptr = index( value, ',' )) != NULL ) *ptr = '\0'; printFormatted( lineLength, FALSE, stdout, "%-19s %s", "Contact:", value ); - free( value ); + ldap_memfree( value ); #if defined(UOFA) } #endif diff --git a/contrib/whois++/output.c b/contrib/whois++/output.c index d1589d48b1..af7b785215 100644 --- a/contrib/whois++/output.c +++ b/contrib/whois++/output.c @@ -48,17 +48,17 @@ LDAPMessage *entry; int i; template = NULL; - dn = strdup( ldap_get_dn( ld, entry ) ); + dn = ldap_get_dn( ld, entry ); ldap_search_s( ld, dn, LDAP_SCOPE_BASE, "objectclass=*", objectClass, 0, &result ); if ( ld->ld_errno != LDAP_SUCCESS ) { printFormatted( lineLength, TRUE, stdout, "Read on object \"%s\" failed, %s", dn, ldap_err2string( ld->ld_errno ) ); - free( dn ); + ldap_memfree( dn ); return; } else - free( dn ); + ldap_memfree( dn ); if ( ( val = ldap_get_values( ld, result, "objectClass" ) ) == NULL ) return; for ( i = 0 ; val[i] != NULL ; i++ ) @@ -256,7 +256,7 @@ char *dn, *attributes[]; printFormatted( lineLength, FALSE, stdout, " %-19s \"%s\"", "Handle", dn ); - free( ufn ); + ldap_memfree( ufn ); } char *attributeLabel( attribute ) diff --git a/contrib/whois++/whois++.c b/contrib/whois++/whois++.c index ce807193e2..023b25b9e9 100644 --- a/contrib/whois++/whois++.c +++ b/contrib/whois++/whois++.c @@ -220,7 +220,7 @@ Please try again later." ); exit( 1 ); } entry = ldap_first_entry( ld, result ); - organisation = strdup( ldap_dn2ufn( ldap_get_dn( ld, entry ) ) ); + organisation = ldap_dn2ufn( ldap_get_dn( ld, entry ) ); category = ldap_get_values( ld, entry, "businessCategory" ); printFormatted( lineLength, FALSE, stdout, -- 2.39.5