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
commit6c34e1a01534e010f744fbfdb5468b7dfacdb23e (patch)
tree0fe15e44717e692453ab3e61371153e070125c96 /source3/rpc_client
parent37b7095c8a408a89e1e8390c89beeabbb88e3823 (diff)
downloadsamba-6c34e1a01534e010f744fbfdb5468b7dfacdb23e.tar.gz
samba-6c34e1a01534e010f744fbfdb5468b7dfacdb23e.tar.bz2
samba-6c34e1a01534e010f744fbfdb5468b7dfacdb23e.zip
s3: Fix Coverity ID 242704 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 27bcb59099..2e51292ee5 100644
--- a/source3/rpc_client/cli_winreg_spoolss.c
+++ b/source3/rpc_client/cli_winreg_spoolss.c
@@ -2547,6 +2547,7 @@ WERROR winreg_printer_get_changeid(TALLOC_CTX *mem_ctx,
char *path;
NTSTATUS status;
WERROR result;
+ WERROR ignore;
TALLOC_CTX *tmp_ctx;
tmp_ctx = talloc_stackframe();
@@ -2598,15 +2599,11 @@ WERROR winreg_printer_get_changeid(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);