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
commit8c2f826553d35fb69cb570ee1b92a2792b603f86 (patch)
treeb740fb65c77aa26cbe02a05fd2da5b1665369544
parent318cf16f7be6df6f4711153c685cbb9a510dfe19 (diff)
downloadsamba-8c2f826553d35fb69cb570ee1b92a2792b603f86.tar.gz
samba-8c2f826553d35fb69cb570ee1b92a2792b603f86.tar.bz2
samba-8c2f826553d35fb69cb570ee1b92a2792b603f86.zip
s3: Fix Coverity ID 242692 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 28e18d10dd..2686c60e62 100644
--- a/source3/rpc_client/cli_winreg_spoolss.c
+++ b/source3/rpc_client/cli_winreg_spoolss.c
@@ -2696,6 +2696,7 @@ WERROR winreg_printer_enumforms1(TALLOC_CTX *mem_ctx,
uint32_t num_builtin = ARRAY_SIZE(builtin_forms1);
uint32_t i;
WERROR result;
+ WERROR ignore;
NTSTATUS status;
const char **enum_names = NULL;
enum winreg_Type *enum_types = NULL;
@@ -2817,15 +2818,11 @@ WERROR winreg_printer_enumforms1(TALLOC_CTX *mem_ctx,
}
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(enum_values);