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
commit995ea20fa27cbb13e090246999385047dbbff1b3 (patch)
tree4129da3a91989aadbeb46b0826586d0b750d7bdb
parent3a8c4ab2adaed1080e3448cd82d22c71c248c97e (diff)
downloadsamba-995ea20fa27cbb13e090246999385047dbbff1b3.tar.gz
samba-995ea20fa27cbb13e090246999385047dbbff1b3.tar.bz2
samba-995ea20fa27cbb13e090246999385047dbbff1b3.zip
s3: Fix Coverity ID 242697 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 51cdb1298c..cd2cf681b8 100644
--- a/source3/rpc_client/cli_winreg_spoolss.c
+++ b/source3/rpc_client/cli_winreg_spoolss.c
@@ -1789,6 +1789,7 @@ WERROR winreg_set_printer_secdesc(TALLOC_CTX *mem_ctx,
TALLOC_CTX *tmp_ctx;
NTSTATUS status;
WERROR result;
+ WERROR ignore;
tmp_ctx = talloc_stackframe();
if (tmp_ctx == NULL) {
@@ -1879,15 +1880,11 @@ WERROR winreg_set_printer_secdesc(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);