1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3: Fix Coverity ID 242699 Dereference before null check

winreg_printer_openkey above already dereferences winreg_handle
This commit is contained in:
Volker Lendecke 2012-05-09 09:16:54 +02:00
parent f9f4d705c2
commit 75271528f3

View File

@ -2861,6 +2861,7 @@ WERROR winreg_printer_deleteform1(TALLOC_CTX *mem_ctx,
uint32_t num_builtin = ARRAY_SIZE(builtin_forms1);
uint32_t i;
WERROR result = WERR_OK;
WERROR ignore;
NTSTATUS status;
TALLOC_CTX *tmp_ctx;
@ -2914,15 +2915,11 @@ WERROR winreg_printer_deleteform1(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);