diff options
author | Andreas Schneider <asn@samba.org> | 2011-07-25 21:33:22 +0200 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2011-07-27 08:50:00 +0200 |
commit | 41c2e711bd04892c68a94d62c98e51bf95af33e8 (patch) | |
tree | 32d72e0e9994b2313a482accd61f6bb961eece20 | |
parent | 022a13f1e0775a6abba4d6a834e09257f6491c26 (diff) | |
download | samba-41c2e711bd04892c68a94d62c98e51bf95af33e8.tar.gz samba-41c2e711bd04892c68a94d62c98e51bf95af33e8.tar.bz2 samba-41c2e711bd04892c68a94d62c98e51bf95af33e8.zip |
s3-spoolss: Use tmp_ctx in winreg_get_printer_secdesc_internal.
-rw-r--r-- | source3/rpc_server/spoolss/srv_spoolss_util.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/source3/rpc_server/spoolss/srv_spoolss_util.c b/source3/rpc_server/spoolss/srv_spoolss_util.c index 820a75b503..7b14a1ca45 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_util.c +++ b/source3/rpc_server/spoolss/srv_spoolss_util.c @@ -523,13 +523,26 @@ WERROR winreg_get_printer_secdesc_internal(TALLOC_CTX *mem_ctx, { WERROR result; struct dcerpc_binding_handle *b; + TALLOC_CTX *tmp_ctx; - result = winreg_printer_binding_handle(mem_ctx, session_info, msg_ctx, &b); - W_ERROR_NOT_OK_RETURN(result); + tmp_ctx = talloc_stackframe(); + if (tmp_ctx == NULL) { + return WERR_NOMEM; + } - return winreg_get_printer_secdesc(mem_ctx, b, - sharename, - psecdesc); + result = winreg_printer_binding_handle(tmp_ctx, session_info, msg_ctx, &b); + if (!W_ERROR_IS_OK(result)) { + talloc_free(tmp_ctx); + return result; + } + + result = winreg_get_printer_secdesc(mem_ctx, + b, + sharename, + psecdesc); + + talloc_free(tmp_ctx); + return result; } WERROR winreg_set_printer_secdesc_internal(TALLOC_CTX *mem_ctx, |