diff options
-rw-r--r-- | source3/rpc_client/cli_winreg_spoolss.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/source3/rpc_client/cli_winreg_spoolss.c b/source3/rpc_client/cli_winreg_spoolss.c index 2686c60e62..a0bbd91c7d 100644 --- a/source3/rpc_client/cli_winreg_spoolss.c +++ b/source3/rpc_client/cli_winreg_spoolss.c @@ -1619,6 +1619,7 @@ WERROR winreg_get_printer_secdesc(TALLOC_CTX *mem_ctx, TALLOC_CTX *tmp_ctx; NTSTATUS status; WERROR result; + WERROR ignore; tmp_ctx = talloc_stackframe(); if (tmp_ctx == NULL) { @@ -1660,7 +1661,6 @@ WERROR winreg_get_printer_secdesc(TALLOC_CTX *mem_ctx, } if (!W_ERROR_IS_OK(result)) { if (W_ERROR_EQUAL(result, WERR_BADFILE)) { - WERROR ignore; if (is_valid_policy_hnd(&key_hnd)) { dcerpc_winreg_CloseKey(winreg_handle, @@ -1758,15 +1758,11 @@ create_default: result = WERR_OK; done: - if (winreg_handle != NULL) { - WERROR ignore; - - if (is_valid_policy_hnd(&key_hnd)) { - dcerpc_winreg_CloseKey(winreg_handle, tmp_ctx, &key_hnd, &ignore); - } - if (is_valid_policy_hnd(&hive_hnd)) { - dcerpc_winreg_CloseKey(winreg_handle, tmp_ctx, &hive_hnd, &ignore); - } + if (is_valid_policy_hnd(&key_hnd)) { + dcerpc_winreg_CloseKey(winreg_handle, tmp_ctx, &key_hnd, &ignore); + } + if (is_valid_policy_hnd(&hive_hnd)) { + dcerpc_winreg_CloseKey(winreg_handle, tmp_ctx, &hive_hnd, &ignore); } talloc_free(tmp_ctx); |