diff options
author | Volker Lendecke <vl@samba.org> | 2012-05-09 09:16:54 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2012-05-10 09:11:56 +0200 |
commit | c0471d1d96149f791401a7d5672ad83306bbc85a (patch) | |
tree | d7121e1da52a81caa03434a14c21bed7f8348ae9 | |
parent | 39577f1e99900c95561fa137e23c0488660bcf5e (diff) | |
download | samba-c0471d1d96149f791401a7d5672ad83306bbc85a.tar.gz samba-c0471d1d96149f791401a7d5672ad83306bbc85a.tar.bz2 samba-c0471d1d96149f791401a7d5672ad83306bbc85a.zip |
s3: Fix Coverity ID 242694 Dereference before null check
winreg_printer_openkey above already dereferences winreg_handle
-rw-r--r-- | source3/rpc_client/cli_winreg_spoolss.c | 15 |
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 1cf034e9f2..c3c853d23f 100644 --- a/source3/rpc_client/cli_winreg_spoolss.c +++ b/source3/rpc_client/cli_winreg_spoolss.c @@ -2452,6 +2452,7 @@ WERROR winreg_printer_update_changeid(TALLOC_CTX *mem_ctx, char *path; NTSTATUS status; WERROR result; + WERROR ignore; TALLOC_CTX *tmp_ctx; tmp_ctx = talloc_stackframe(); @@ -2497,15 +2498,11 @@ WERROR winreg_printer_update_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); |