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
commit318cf16f7be6df6f4711153c685cbb9a510dfe19 (patch)
treec6ec39a766ee9ee106b16cc4873a0923e4acd5b1 /source3/rpc_client
parentc0471d1d96149f791401a7d5672ad83306bbc85a (diff)
downloadsamba-318cf16f7be6df6f4711153c685cbb9a510dfe19.tar.gz
samba-318cf16f7be6df6f4711153c685cbb9a510dfe19.tar.bz2
samba-318cf16f7be6df6f4711153c685cbb9a510dfe19.zip
s3: Fix Coverity ID 242693 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 c3c853d23f..28e18d10dd 100644
--- a/source3/rpc_client/cli_winreg_spoolss.c
+++ b/source3/rpc_client/cli_winreg_spoolss.c
@@ -2602,6 +2602,7 @@ WERROR winreg_printer_addform1(TALLOC_CTX *mem_ctx,
union spoolss_FormInfo *info = NULL;
uint32_t i;
WERROR result;
+ WERROR ignore;
NTSTATUS status;
TALLOC_CTX *tmp_ctx;
@@ -2670,15 +2671,11 @@ WERROR winreg_printer_addform1(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(info);