summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-05-09 09:16:54 +0200
committerVolker Lendecke <vl@samba.org>2012-05-10 09:11:56 +0200
commit67e306703b55cb7683bf772c3df36815361701c9 (patch)
tree5afeef1e374456b447045b8b2ee5c970422a1fcc
parent37609ba6b89394648cb8d4555b9f6f8c2dd88ef7 (diff)
downloadsamba-67e306703b55cb7683bf772c3df36815361701c9.tar.gz
samba-67e306703b55cb7683bf772c3df36815361701c9.tar.bz2
samba-67e306703b55cb7683bf772c3df36815361701c9.zip
s3: Fix Coverity ID 242706 Dereference before null check
winreg_printer_openkey above already dereferences winreg_handle
-rw-r--r--source3/rpc_client/cli_winreg_spoolss.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/source3/rpc_client/cli_winreg_spoolss.c b/source3/rpc_client/cli_winreg_spoolss.c
index 49b67aa48f..64495f4135 100644
--- a/source3/rpc_client/cli_winreg_spoolss.c
+++ b/source3/rpc_client/cli_winreg_spoolss.c
@@ -1995,6 +1995,7 @@ WERROR winreg_get_printer_dataex(TALLOC_CTX *mem_ctx,
uint32_t data_in_size = 0;
uint32_t value_len = 0;
WERROR result = WERR_OK;
+ WERROR ignore;
NTSTATUS status;
TALLOC_CTX *tmp_ctx;
@@ -2090,15 +2091,11 @@ WERROR winreg_get_printer_dataex(TALLOC_CTX *mem_ctx,
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);