summaryrefslogtreecommitdiff
path: root/source3/rpc_client
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
commit3a8c4ab2adaed1080e3448cd82d22c71c248c97e (patch)
tree2144feeb4ecf9f2e7332e9109006c394b1474390 /source3/rpc_client
parent75271528f3289c18794c827ccd17a62ba5196ef7 (diff)
downloadsamba-3a8c4ab2adaed1080e3448cd82d22c71c248c97e.tar.gz
samba-3a8c4ab2adaed1080e3448cd82d22c71c248c97e.tar.bz2
samba-3a8c4ab2adaed1080e3448cd82d22c71c248c97e.zip
s3: Fix Coverity ID 242698 Dereference before null check
winreg_printer_openkey above already dereferences winreg_handle
Diffstat (limited to 'source3/rpc_client')
-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 8667692321..51cdb1298c 100644
--- a/source3/rpc_client/cli_winreg_spoolss.c
+++ b/source3/rpc_client/cli_winreg_spoolss.c
@@ -936,6 +936,7 @@ WERROR winreg_update_printer(TALLOC_CTX *mem_ctx,
DATA_BLOB blob;
char *path;
WERROR result = WERR_OK;
+ WERROR ignore;
NTSTATUS status;
TALLOC_CTX *tmp_ctx;
@@ -1318,15 +1319,11 @@ WERROR winreg_update_printer(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);