mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s3: Fix Coverity ID 242693 Dereference before null check
winreg_printer_openkey above already dereferences winreg_handle
This commit is contained in:
parent
c0471d1d96
commit
318cf16f7b
@ -2602,6 +2602,7 @@ WERROR winreg_printer_addform1(TALLOC_CTX *mem_ctx,
|
||||
union spoolss_FormInfo *info = NULL;
|
||||
uint32_t i;
|
||||
WERROR result;
|
||||
WERROR ignore;
|
||||
NTSTATUS status;
|
||||
TALLOC_CTX *tmp_ctx;
|
||||
|
||||
@ -2670,15 +2671,11 @@ WERROR winreg_printer_addform1(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(info);
|
||||
|
Loading…
Reference in New Issue
Block a user