Commit 821423d3 authored by rvargas's avatar rvargas Committed by Commit bot

Sandbox: Don't CloseHandle after calling DuplicateHandle

DuplicateHandle closes the handle even if there's an error.

BUG=412200
R=cpu@chromium.org

Review URL: https://codereview.chromium.org/554163002

Cr-Commit-Position: refs/heads/master@{#294078}
parent 06ff961b
......@@ -124,7 +124,6 @@ NTSTATUS ProcessPolicy::OpenThreadAction(const ClientInfo& client_info,
if (!::DuplicateHandle(::GetCurrentProcess(), local_handle,
client_info.process, handle, 0, FALSE,
DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) {
::CloseHandle(local_handle);
return STATUS_ACCESS_DENIED;
}
}
......@@ -156,7 +155,6 @@ NTSTATUS ProcessPolicy::OpenProcessAction(const ClientInfo& client_info,
if (!::DuplicateHandle(::GetCurrentProcess(), local_handle,
client_info.process, handle, 0, FALSE,
DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) {
::CloseHandle(local_handle);
return STATUS_ACCESS_DENIED;
}
}
......@@ -182,7 +180,6 @@ NTSTATUS ProcessPolicy::OpenProcessTokenAction(const ClientInfo& client_info,
if (!::DuplicateHandle(::GetCurrentProcess(), local_handle,
client_info.process, handle, 0, FALSE,
DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) {
::CloseHandle(local_handle);
return STATUS_ACCESS_DENIED;
}
}
......@@ -208,7 +205,6 @@ NTSTATUS ProcessPolicy::OpenProcessTokenExAction(const ClientInfo& client_info,
if (!::DuplicateHandle(::GetCurrentProcess(), local_handle,
client_info.process, handle, 0, FALSE,
DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) {
::CloseHandle(local_handle);
return STATUS_ACCESS_DENIED;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment