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
commite0bc3767e351bdf6ba90ebea00cfa089341aea14 (patch)
treee1609890d2cd950ec858c55c2fb10ced521d85f5 /source3/rpc_client
parent11085bd93ab18a560a2e390f3f3c776b96c8d024 (diff)
downloadsamba-e0bc3767e351bdf6ba90ebea00cfa089341aea14.tar.gz
samba-e0bc3767e351bdf6ba90ebea00cfa089341aea14.tar.bz2
samba-e0bc3767e351bdf6ba90ebea00cfa089341aea14.zip
s3: Fix Coverity ID 242702 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 bf69bf1c90..96de05a233 100644
--- a/source3/rpc_client/cli_winreg_spoolss.c
+++ b/source3/rpc_client/cli_winreg_spoolss.c
@@ -2118,6 +2118,7 @@ WERROR winreg_enum_printer_dataex(TALLOC_CTX *mem_ctx,
uint32_t num_values = 0;
char *path;
WERROR result = WERR_OK;
+ WERROR ignore;
NTSTATUS status;
const char **enum_names = NULL;
enum winreg_Type *enum_types = NULL;
@@ -2198,15 +2199,11 @@ WERROR winreg_enum_printer_dataex(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);