From fb5362c069b5b6548478b2217a0519c56d856705 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 20 Feb 2006 17:59:58 +0000 Subject: r13571: Replace all calls to talloc_free() with thye TALLOC_FREE() macro which sets the freed pointer to NULL. (This used to be commit b65be8874a2efe5a4b167448960a4fcf6bd995e2) --- source3/auth/auth_compat.c | 2 +- source3/auth/auth_ntlmssp.c | 2 +- source3/auth/auth_server.c | 2 +- source3/auth/auth_util.c | 30 +++++++++++++++--------------- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'source3/auth') diff --git a/source3/auth/auth_compat.c b/source3/auth/auth_compat.c index 28b9de8d43..bd5d7f0229 100644 --- a/source3/auth/auth_compat.c +++ b/source3/auth/auth_compat.c @@ -84,7 +84,7 @@ static NTSTATUS pass_check_smb(const char *smb_name, } else { nt_status = check_plaintext_password(smb_name, plaintext_password, &server_info); } - talloc_free(server_info); + TALLOC_FREE(server_info); return nt_status; } diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c index 2bf86860cc..1d3d17d60d 100644 --- a/source3/auth/auth_ntlmssp.c +++ b/source3/auth/auth_ntlmssp.c @@ -187,7 +187,7 @@ void auth_ntlmssp_end(AUTH_NTLMSSP_STATE **auth_ntlmssp_state) ((*auth_ntlmssp_state)->auth_context->free)(&(*auth_ntlmssp_state)->auth_context); } if ((*auth_ntlmssp_state)->server_info) { - talloc_free((*auth_ntlmssp_state)->server_info); + TALLOC_FREE((*auth_ntlmssp_state)->server_info); } talloc_destroy(mem_ctx); *auth_ntlmssp_state = NULL; diff --git a/source3/auth/auth_server.c b/source3/auth/auth_server.c index 8eed8bba6a..7bec1b4128 100644 --- a/source3/auth/auth_server.c +++ b/source3/auth/auth_server.c @@ -384,7 +384,7 @@ use this machine as the password server.\n")); real_username, True )) != NULL ) { nt_status = make_server_info_pw(server_info, pass->pw_name, pass); - talloc_free(pass); + TALLOC_FREE(pass); } else { diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index ad02b24a42..3e7c520fc5 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -522,7 +522,7 @@ static int server_info_dtor(void *p) } /*************************************************************************** - Make a server_info struct. Free with talloc_free(). + Make a server_info struct. Free with TALLOC_FREE(). ***************************************************************************/ static auth_serversupplied_info *make_server_info(TALLOC_CTX *mem_ctx) @@ -565,7 +565,7 @@ NTSTATUS make_server_info_sam(auth_serversupplied_info **server_info, } if ( !(result = make_server_info(NULL)) ) { - talloc_free(pwd); + TALLOC_FREE(pwd); return NT_STATUS_NO_MEMORY; } @@ -574,7 +574,7 @@ NTSTATUS make_server_info_sam(auth_serversupplied_info **server_info, result->gid = pwd->pw_gid; result->uid = pwd->pw_uid; - talloc_free(pwd); + TALLOC_FREE(pwd); status = pdb_enum_group_memberships(result, sampass, &result->sids, &gids, @@ -584,14 +584,14 @@ NTSTATUS make_server_info_sam(auth_serversupplied_info **server_info, DEBUG(10, ("pdb_enum_group_memberships failed: %s\n", nt_errstr(status))); result->sam_account = NULL; /* Don't free on error exit. */ - talloc_free(result); + TALLOC_FREE(result); return status; } /* For now we throw away the gids and convert via sid_to_gid * later. This needs fixing, but I'd like to get the code straight and * simple first. */ - talloc_free(gids); + TALLOC_FREE(gids); DEBUG(5,("make_server_info_sam: made server info for user %s -> %s\n", pdb_get_username(sampass), result->unix_name)); @@ -793,7 +793,7 @@ static struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx, talloc_steal(mem_ctx, result); done: - talloc_free(tmp_ctx); + TALLOC_FREE(tmp_ctx); return result; } @@ -846,7 +846,7 @@ NTSTATUS create_local_token(auth_serversupplied_info *server_info) status = log_nt_token(mem_ctx, server_info->ptok); - talloc_free(mem_ctx); + TALLOC_FREE(mem_ctx); return status; } @@ -1014,7 +1014,7 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username, result = NT_STATUS_OK; done: - talloc_free(tmp_ctx); + TALLOC_FREE(tmp_ctx); return result; } @@ -1052,7 +1052,7 @@ BOOL user_in_group_sid(const char *username, const DOM_SID *group_sid) result = nt_token_check_sid(group_sid, token); - talloc_free(mem_ctx); + TALLOC_FREE(mem_ctx); return result; } @@ -1072,7 +1072,7 @@ BOOL user_in_group(const char *username, const char *groupname) ret = lookup_name(mem_ctx, groupname, LOOKUP_NAME_ALL, NULL, NULL, &group_sid, NULL); - talloc_free(mem_ctx); + TALLOC_FREE(mem_ctx); if (!ret) { DEBUG(10, ("lookup_name(%s) failed: %s\n", groupname, @@ -1182,14 +1182,14 @@ NTSTATUS make_server_info_pw(auth_serversupplied_info **server_info, if (!NT_STATUS_IS_OK(status)) { DEBUG(10, ("pdb_enum_group_memberships failed: %s\n", nt_errstr(status))); - talloc_free(result); + TALLOC_FREE(result); return status; } /* For now we throw away the gids and convert via sid_to_gid * later. This needs fixing, but I'd like to get the code straight and * simple first. */ - talloc_free(gids); + TALLOC_FREE(gids); *server_info = result; @@ -1349,7 +1349,7 @@ static NTSTATUS fill_sam_account(TALLOC_CTX *mem_ctx, *found_username)); nt_status = pdb_init_sam_pw(sam_account, passwd); - talloc_free(passwd); + TALLOC_FREE(passwd); return nt_status; } @@ -1622,7 +1622,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx, info3->gids[i].g_rid)) { DEBUG(3,("could not append additional group rid " "0x%x\n", info3->gids[i].g_rid)); - talloc_free(result); + TALLOC_FREE(result); return NT_STATUS_INVALID_PARAMETER; } add_sid_to_array(result, &sid, &result->sids, @@ -1742,7 +1742,7 @@ NT_USER_TOKEN *dup_nt_token(TALLOC_CTX *mem_ctx, NT_USER_TOKEN *ptoken) if ((ptoken->user_sids != NULL) && (token->user_sids == NULL)) { DEBUG(0, ("talloc_memdup failed\n")); - talloc_free(token); + TALLOC_FREE(token); return NULL; } -- cgit