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
commitf9f4d705c2121ce3efddae0b634c43f2fa3ee0d0 (patch)
tree71fe8f8068564a850d1c2529f9e2527db3283b4b /source3/rpc_client
parenta7b23cec6dae3e20b144261705e8674b1d0cca12 (diff)
downloadsamba-f9f4d705c2121ce3efddae0b634c43f2fa3ee0d0.tar.gz
samba-f9f4d705c2121ce3efddae0b634c43f2fa3ee0d0.tar.bz2
samba-f9f4d705c2121ce3efddae0b634c43f2fa3ee0d0.zip
s3: Fix Coverity ID 242700 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 2b7215f9f4..fa7096cf77 100644
--- a/source3/rpc_client/cli_winreg_spoolss.c
+++ b/source3/rpc_client/cli_winreg_spoolss.c
@@ -2371,6 +2371,7 @@ WERROR winreg_delete_printer_key(TALLOC_CTX *mem_ctx,
char *keyname;
char *path;
WERROR result;
+ WERROR ignore;
NTSTATUS status;
TALLOC_CTX *tmp_ctx;
@@ -2443,15 +2444,11 @@ WERROR winreg_delete_printer_key(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);