mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-15 03:01:09 +08:00
Free() -> ldap_memfree() changes. Remove use of the return value of free().
This commit is contained in:
parent
4459780fb3
commit
ac536906c5
@ -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);
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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 *
|
||||
|
Loading…
Reference in New Issue
Block a user