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 | 37b7095c8a408a89e1e8390c89beeabbb88e3823 (patch) | |
tree | da0077f67a1367e14ac2ef99346f0cc25bddfb65 | |
parent | 67e306703b55cb7683bf772c3df36815361701c9 (diff) | |
download | samba-37b7095c8a408a89e1e8390c89beeabbb88e3823.tar.gz samba-37b7095c8a408a89e1e8390c89beeabbb88e3823.tar.bz2 samba-37b7095c8a408a89e1e8390c89beeabbb88e3823.zip |
s3: Fix Coverity ID 242705 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 64495f4135..27bcb59099 100644 --- a/source3/rpc_client/cli_winreg_spoolss.c +++ b/source3/rpc_client/cli_winreg_spoolss.c @@ -3056,6 +3056,7 @@ WERROR winreg_printer_getform1(TALLOC_CTX *mem_ctx, uint32_t num_builtin = ARRAY_SIZE(builtin_forms1); uint32_t i; WERROR result; + WERROR ignore; NTSTATUS status; TALLOC_CTX *tmp_ctx; @@ -3158,15 +3159,11 @@ WERROR winreg_printer_getform1(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); |