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
commit75271528f3289c18794c827ccd17a62ba5196ef7 (patch)
treeeb7cc0633ba0aca867fff45ade910ab0c24a88d4
parentf9f4d705c2121ce3efddae0b634c43f2fa3ee0d0 (diff)
downloadsamba-75271528f3289c18794c827ccd17a62ba5196ef7.tar.gz
samba-75271528f3289c18794c827ccd17a62ba5196ef7.tar.bz2
samba-75271528f3289c18794c827ccd17a62ba5196ef7.zip
s3: Fix Coverity ID 242699 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 fa7096cf77..8667692321 100644
--- a/source3/rpc_client/cli_winreg_spoolss.c
+++ b/source3/rpc_client/cli_winreg_spoolss.c
@@ -2861,6 +2861,7 @@ WERROR winreg_printer_deleteform1(TALLOC_CTX *mem_ctx,
uint32_t num_builtin = ARRAY_SIZE(builtin_forms1);
uint32_t i;
WERROR result = WERR_OK;
+ WERROR ignore;
NTSTATUS status;
TALLOC_CTX *tmp_ctx;
@@ -2914,15 +2915,11 @@ WERROR winreg_printer_deleteform1(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(tmp_ctx);