diff options
author | Andreas Schneider <asn@samba.org> | 2011-07-25 22:31:08 +0200 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2011-07-27 08:49:58 +0200 |
commit | a0597b75e6794d8bfe7e43bf36378b2421afc9c7 (patch) | |
tree | 69e63ea71b0ec9f146d77179fa5a050edf38f3c6 /source3 | |
parent | fe7e4ac462608200a98c64338e7b5cddda2fda71 (diff) | |
download | samba-a0597b75e6794d8bfe7e43bf36378b2421afc9c7.tar.gz samba-a0597b75e6794d8bfe7e43bf36378b2421afc9c7.tar.bz2 samba-a0597b75e6794d8bfe7e43bf36378b2421afc9c7.zip |
s3-rpc_client: Close hive if opening of the key fails.
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_client/cli_winreg_spoolss.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/rpc_client/cli_winreg_spoolss.c b/source3/rpc_client/cli_winreg_spoolss.c index 9b7c72421c..d0c048c3cc 100644 --- a/source3/rpc_client/cli_winreg_spoolss.c +++ b/source3/rpc_client/cli_winreg_spoolss.c @@ -298,9 +298,19 @@ static WERROR winreg_printer_openkey(TALLOC_CTX *mem_ctx, &result); } if (!NT_STATUS_IS_OK(status)) { - return ntstatus_to_werror(status); + result = ntstatus_to_werror(status); } if (!W_ERROR_IS_OK(result)) { + WERROR ignore; + + if (is_valid_policy_hnd(hive_handle)) { + dcerpc_winreg_CloseKey(binding_handle, + mem_ctx, + hive_handle, + &ignore); + } + ZERO_STRUCTP(hive_handle); + return result; } |