From ac536906c5b1c410516f911e51a5b5d1c44aed73 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Sat, 27 Mar 1999 16:43:56 +0000 Subject: [PATCH] Free() -> ldap_memfree() changes. Remove use of the return value of free(). --- clients/ud/edit.c | 2 +- clients/ud/find.c | 6 +++--- clients/ud/group.c | 4 ++-- clients/ud/main.c | 4 ++-- clients/ud/mod.c | 4 ++-- clients/ud/print.c | 2 +- clients/ud/util.c | 9 --------- 7 files changed, 11 insertions(+), 20 deletions(-) diff --git a/clients/ud/edit.c b/clients/ud/edit.c index 8bdab14f9d..458a38098a 100644 --- a/clients/ud/edit.c +++ b/clients/ud/edit.c @@ -93,7 +93,7 @@ edit( char *who ) } dn = ldap_get_dn(ld, ldap_first_entry(ld, mp)); rdns = ldap_explode_dn(dn, TRUE); - Free(dn); + ldap_memfree(dn); if (verbose) { printf("\n Editing directory entry \"%s\"...\n", *rdns); } diff --git a/clients/ud/find.c b/clients/ud/find.c index ce4f1558b0..8a5e0dddd6 100644 --- a/clients/ud/find.c +++ b/clients/ud/find.c @@ -223,7 +223,7 @@ find( char *who, int quiet ) } else if (matches == 1) { dn = ldap_get_dn(ld, ldap_first_entry(ld, res)); rc = ldap_search_s(ld, dn, LDAP_SCOPE_BASE, "objectClass=*", read_attrs, FALSE, &res); - Free(dn); + ldap_memfree(dn); if (rc != LDAP_SUCCESS) { int ld_errno = 0; ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ld_errno); @@ -291,7 +291,7 @@ find( char *who, int quiet ) fetch_buffer(response, sizeof(response), stdin); if ((response[0] == 'n') || (response[0] == 'N')) { - Free(dn); + ldap_memfree(dn); return(NULL); } } @@ -314,7 +314,7 @@ find( char *who, int quiet ) ldap_msgfree(res); res = NULL; } - Free(dn); + ldap_memfree(dn); return(res); } else if (matches > 0) { diff --git a/clients/ud/group.c b/clients/ud/group.c index d58dd020b8..54a79a96db 100644 --- a/clients/ud/group.c +++ b/clients/ud/group.c @@ -1066,7 +1066,7 @@ list_groups( char *who ) /* lookup the groups belonging to this person */ sprintf(filter, "owner=%s", dn); - Free(dn); + ldap_memfree(dn); search_attrs[0] = "cn"; search_attrs[1] = NULL; if ((rc = ldap_search_s(ld, UD_WHERE_ALL_GROUPS_LIVE, LDAP_SCOPE_SUBTREE, @@ -1199,7 +1199,7 @@ list_memberships( char *who ) /* lookup the groups belonging to this person */ sprintf(filter, "member=%s", dn); - Free(dn); + ldap_memfree(dn); search_attrs[0] = "cn"; search_attrs[1] = NULL; ldap_msgfree(mp); diff --git a/clients/ud/main.c b/clients/ud/main.c index 6dd447411a..61de28d472 100644 --- a/clients/ud/main.c +++ b/clients/ud/main.c @@ -485,7 +485,7 @@ change_base( int type, char **base, char *s ) if (j == 0) { (void) ldap_msgfree(mp); for (i = 0; i < matches; i++) - Free(choices[i]); + ldap_memfree(choices[i]); return; } if ((j < 1) || (j >= i)) @@ -495,7 +495,7 @@ change_base( int type, char **base, char *s ) printbase(output_string, *base); (void) ldap_msgfree(mp); for (i = 0; choices[i] != NULL; i++) - Free(choices[i]); + ldap_memfree(choices[i]); return; } } diff --git a/clients/ud/mod.c b/clients/ud/mod.c index b0539ba79f..82de3e2d57 100644 --- a/clients/ud/mod.c +++ b/clients/ud/mod.c @@ -147,7 +147,7 @@ modify( char *who ) parse_answer(mp); (void) ldap_msgfree(mp); } - (void) Free(dn); + ldap_memfree(dn); ldap_value_free(rdns); return; } @@ -483,7 +483,7 @@ mail_is_good: } tmp = ldap_get_dn(ld, elmp); strcpy(buffer, tmp); - Free(tmp); + ldap_memfree(tmp); (void) ldap_msgfree(lmp); break; } diff --git a/clients/ud/print.c b/clients/ud/print.c index de0a946a90..984ee0b47d 100644 --- a/clients/ud/print.c +++ b/clients/ud/print.c @@ -415,7 +415,7 @@ clear_entry( void ) printf(" Clearing entry \"%s\"\n", Entry.name); #endif if (Entry.DN != NULL) - Free(Entry.DN); + ldap_memfree(Entry.DN); if (Entry.name != NULL) Free(Entry.name); Entry.may_join = FALSE; diff --git a/clients/ud/util.c b/clients/ud/util.c index 8371c3e867..e7ab7626bb 100644 --- a/clients/ud/util.c +++ b/clients/ud/util.c @@ -579,16 +579,7 @@ Malloc( unsigned int size ) void Free( void *ptr ) { -#if 0 - if (free(ptr) < 0) { - perror("free"); - exit(-1); - /*NOTREACHED*/ - } -#else free(ptr); -#endif - return; } char * -- 2.39.5