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
commit11085bd93ab18a560a2e390f3f3c776b96c8d024 (patch)
treee44140e56817f42b75a652d2436324fce93389ed
parent6c34e1a01534e010f744fbfdb5468b7dfacdb23e (diff)
downloadsamba-11085bd93ab18a560a2e390f3f3c776b96c8d024.tar.gz
samba-11085bd93ab18a560a2e390f3f3c776b96c8d024.tar.bz2
samba-11085bd93ab18a560a2e390f3f3c776b96c8d024.zip
s3: Fix Coverity ID 242703 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 2e51292ee5..bf69bf1c90 100644
--- a/source3/rpc_client/cli_winreg_spoolss.c
+++ b/source3/rpc_client/cli_winreg_spoolss.c
@@ -2300,6 +2300,7 @@ WERROR winreg_enum_printer_key(TALLOC_CTX *mem_ctx,
uint32_t num_subkeys = -1;
WERROR result = WERR_OK;
+ WERROR ignore;
NTSTATUS status;
TALLOC_CTX *tmp_ctx;
@@ -2354,15 +2355,11 @@ WERROR winreg_enum_printer_key(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);