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

s3: Fix Coverity ID 242704 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 37b7095c8a
commit 6c34e1a015

View File

@ -2547,6 +2547,7 @@ WERROR winreg_printer_get_changeid(TALLOC_CTX *mem_ctx,
char *path;
NTSTATUS status;
WERROR result;
WERROR ignore;
TALLOC_CTX *tmp_ctx;
tmp_ctx = talloc_stackframe();
@ -2598,15 +2599,11 @@ WERROR winreg_printer_get_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);