From: Volker Lendecke Date: Sun, 6 Jan 2008 13:17:15 +0000 (+0100) Subject: use talloc_tos() in share_access_check() X-Git-Tag: samba-3.2.0pre2~52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ac2bb838d537ca563ad2fe770b3e1c2fe8b1d9e7;p=thirdparty%2Fsamba.git use talloc_tos() in share_access_check() --- diff --git a/source/lib/sharesec.c b/source/lib/sharesec.c index ba025dacc15..f6ff701d5b7 100644 --- a/source/lib/sharesec.c +++ b/source/lib/sharesec.c @@ -228,25 +228,20 @@ bool share_access_check(const NT_USER_TOKEN *token, const char *sharename, { uint32 granted; NTSTATUS status; - TALLOC_CTX *mem_ctx = NULL; SEC_DESC *psd = NULL; size_t sd_size; bool ret = True; - if (!(mem_ctx = talloc_init("share_access_check"))) { - return False; - } - - psd = get_share_security(mem_ctx, sharename, &sd_size); + psd = get_share_security(talloc_tos(), sharename, &sd_size); if (!psd) { - TALLOC_FREE(mem_ctx); return True; } ret = se_access_check(psd, token, desired_access, &granted, &status); - talloc_destroy(mem_ctx); + TALLOC_FREE(psd); + return ret; }