summaryrefslogtreecommitdiff
path: root/source3/smbd/sec_ctx.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2001-09-17 11:25:41 +0000
committerSimo Sorce <idra@samba.org>2001-09-17 11:25:41 +0000
commit61b2794968faa35dc91edce17e9b91e5366c3514 (patch)
tree3fd9ec24adcdf149263066754f5e51ac7a4e14e0 /source3/smbd/sec_ctx.c
parent87945989c0383bd012be7ab8bc5920b6d03fa105 (diff)
downloadsamba-61b2794968faa35dc91edce17e9b91e5366c3514.tar.gz
samba-61b2794968faa35dc91edce17e9b91e5366c3514.tar.bz2
samba-61b2794968faa35dc91edce17e9b91e5366c3514.zip
move to SAFE_FREE()
(This used to be commit a95943fde0ad89ae3f2deca2f7ba9cb5ab612b74)
Diffstat (limited to 'source3/smbd/sec_ctx.c')
-rw-r--r--source3/smbd/sec_ctx.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/source3/smbd/sec_ctx.c b/source3/smbd/sec_ctx.c
index e0e392decc..72e23306ec 100644
--- a/source3/smbd/sec_ctx.c
+++ b/source3/smbd/sec_ctx.c
@@ -157,7 +157,7 @@ int get_current_groups(int *p_ngroups, gid_t **p_groups)
}
if ((ngroups = sys_getgroups(ngroups,groups)) == -1) {
- safe_free(groups);
+ SAFE_FREE(groups);
return -1;
}
@@ -181,11 +181,10 @@ void delete_nt_token(NT_USER_TOKEN **pptoken)
{
if (*pptoken) {
NT_USER_TOKEN *ptoken = *pptoken;
- safe_free( ptoken->user_sids );
+ SAFE_FREE( ptoken->user_sids );
ZERO_STRUCTP(ptoken);
}
- safe_free(*pptoken);
- *pptoken = NULL;
+ SAFE_FREE(*pptoken);
}
/****************************************************************************
@@ -205,7 +204,7 @@ NT_USER_TOKEN *dup_nt_token(NT_USER_TOKEN *ptoken)
ZERO_STRUCTP(token);
if ((token->user_sids = (DOM_SID *)memdup( ptoken->user_sids, sizeof(DOM_SID) * ptoken->num_sids )) == NULL) {
- free(token);
+ SAFE_FREE(token);
return NULL;
}
@@ -244,8 +243,7 @@ BOOL initialise_groups(char *user, uid_t uid, gid_t gid)
prev_ctx_p = &sec_ctx_stack[sec_ctx_stack_ndx - 1];
- safe_free(prev_ctx_p->groups);
- prev_ctx_p->groups = NULL;
+ SAFE_FREE(prev_ctx_p->groups);
prev_ctx_p->ngroups = 0;
get_current_groups(&prev_ctx_p->ngroups, &prev_ctx_p->groups);
@@ -336,7 +334,7 @@ void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups, NT_USER_TOKEN
ctx_p->ngroups = ngroups;
- safe_free(ctx_p->groups);
+ SAFE_FREE(ctx_p->groups);
if (token && (token == ctx_p->token))
smb_panic("DUPLICATE_TOKEN");
@@ -393,7 +391,7 @@ BOOL pop_sec_ctx(void)
ctx_p->uid = (uid_t)-1;
ctx_p->gid = (gid_t)-1;
- safe_free(ctx_p->groups);
+ SAFE_FREE(ctx_p->groups);
ctx_p->ngroups = 0;
delete_nt_token(&ctx_p->token);