From b50d10c2a313b45bbc195b13a353a20af0ab917a Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 17 Sep 2001 04:52:45 +0000 Subject: move to SAFE_FREE() (This used to be commit 03dc67788f68c9e01b5a82fdf43f837cb19f4608) --- source3/nsswitch/winbindd_user.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'source3/nsswitch/winbindd_user.c') diff --git a/source3/nsswitch/winbindd_user.c b/source3/nsswitch/winbindd_user.c index 9e0c1e8344..aa138cfdeb 100644 --- a/source3/nsswitch/winbindd_user.c +++ b/source3/nsswitch/winbindd_user.c @@ -398,12 +398,9 @@ static BOOL get_sam_user_entries(struct getent_state *ent) /* Free any existing user info */ - if (ent->sam_entries) { - free(ent->sam_entries); - ent->sam_entries = NULL; - ent->num_sam_entries = 0; - } - + SAFE_FREE(ent->sam_entries); + ent->num_sam_entries = 0; + /* Call query_dispinfo to get a list of usernames and user rids */ do { @@ -425,8 +422,7 @@ static BOOL get_sam_user_entries(struct getent_state *ent) if (!tnl) { DEBUG(0,("get_sam_user_entries: Realloc failed.\n")); - if (name_list) - free(name_list); + SAFE_FREE(name_list); return WINBINDD_ERROR; } else name_list = tnl; @@ -535,13 +531,12 @@ enum winbindd_result winbindd_getpwent(struct winbindd_cli_state *state) /* Free state information for this domain */ - safe_free(ent->sam_entries); - ent->sam_entries = NULL; + SAFE_FREE(ent->sam_entries); next_ent = ent->next; DLIST_REMOVE(state->getpwent_state, ent); - free(ent); + SAFE_FREE(ent); ent = next_ent; } @@ -653,7 +648,7 @@ enum winbindd_result winbindd_list_users(struct winbindd_cli_state *state) if (!ted) { DEBUG(0,("winbindd_list_users: failed to enlarge buffer!\n")); - if (extra_data) free(extra_data); + SAFE_FREE(extra_data); return WINBINDD_ERROR; } else extra_data = ted; -- cgit