diff options
author | Volker Lendecke <vl@samba.org> | 2012-10-20 07:20:39 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2012-10-20 07:21:26 +0200 |
commit | 75724d9eb14cd288297f3f5228fb3d10a11861dc (patch) | |
tree | e02e841decd220fdefdc5838fc00b6fb13a6ce66 /source3/smbd | |
parent | 96356219d662614cbc926d6c2dc4345f0ac432ce (diff) | |
download | samba-75724d9eb14cd288297f3f5228fb3d10a11861dc.tar.gz samba-75724d9eb14cd288297f3f5228fb3d10a11861dc.tar.bz2 samba-75724d9eb14cd288297f3f5228fb3d10a11861dc.zip |
s3: Use talloc_stackframe in token_contains_name_in_list
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/share_access.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/source3/smbd/share_access.c b/source3/smbd/share_access.c index 7087a985a9..aa3bd3965c 100644 --- a/source3/smbd/share_access.c +++ b/source3/smbd/share_access.c @@ -162,26 +162,21 @@ bool token_contains_name_in_list(const char *username, const struct security_token *token, const char **list) { - TALLOC_CTX *mem_ctx; - if (list == NULL) { return False; } - - if ( (mem_ctx = talloc_new(NULL)) == NULL ) { - smb_panic("talloc_new failed"); - } - while (*list != NULL) { - if (token_contains_name(mem_ctx, username, domain, sharename, - token, *list)) { - TALLOC_FREE(mem_ctx); - return True; + TALLOC_CTX *frame = talloc_stackframe(); + bool ret; + + ret = token_contains_name(frame, username, domain, sharename, + token, *list); + TALLOC_FREE(frame); + if (ret) { + return true; } list += 1; } - - TALLOC_FREE(mem_ctx); return False; } |