1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

s3-rpc_client: Close hive if opening of the key fails.

This commit is contained in:
Andreas Schneider 2011-07-25 22:31:08 +02:00
parent fe7e4ac462
commit a0597b75e6

View File

@ -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;
}