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
commit600c4c9c45396f2521f413abb0a4e1a3567b869c (patch)
treea0fae8595007e4482c4b2a2004a13dee1c7c1767
parent995ea20fa27cbb13e090246999385047dbbff1b3 (diff)
downloadsamba-600c4c9c45396f2521f413abb0a4e1a3567b869c.tar.gz
samba-600c4c9c45396f2521f413abb0a4e1a3567b869c.tar.bz2
samba-600c4c9c45396f2521f413abb0a4e1a3567b869c.zip
s3: Fix Coverity ID 242696 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 cd2cf681b8..1d90d5e69e 100644
--- a/source3/rpc_client/cli_winreg_spoolss.c
+++ b/source3/rpc_client/cli_winreg_spoolss.c
@@ -1906,6 +1906,7 @@ WERROR winreg_set_printer_dataex(TALLOC_CTX *mem_ctx,
struct winreg_String wvalue = { 0, };
char *path;
WERROR result = WERR_OK;
+ WERROR ignore;
NTSTATUS status;
TALLOC_CTX *tmp_ctx;
@@ -1955,15 +1956,11 @@ WERROR winreg_set_printer_dataex(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);