| Index: sandbox/win/tools/finder/finder.cc
|
| diff --git a/sandbox/win/tools/finder/finder.cc b/sandbox/win/tools/finder/finder.cc
|
| index 7753dd03e374cfd195cc4ab299c811ce3a410ac2..9b829628e3e691c2f65d4dae3453df580a6cced3 100644
|
| --- a/sandbox/win/tools/finder/finder.cc
|
| +++ b/sandbox/win/tools/finder/finder.cc
|
| @@ -10,12 +10,15 @@
|
| file_output_ = NULL;
|
| object_type_ = 0;
|
| access_type_ = 0;
|
| + token_handle_ = NULL;
|
| memset(filesystem_stats_, 0, sizeof(filesystem_stats_));
|
| memset(registry_stats_, 0, sizeof(registry_stats_));
|
| memset(kernel_object_stats_, 0, sizeof(kernel_object_stats_));
|
| }
|
|
|
| Finder::~Finder() {
|
| + if (token_handle_)
|
| + ::CloseHandle(token_handle_);
|
| }
|
|
|
| DWORD Finder::Init(sandbox::TokenLevel token_type,
|
| @@ -32,14 +35,14 @@
|
| access_type_ = access_type;
|
| file_output_ = file_output;
|
|
|
| - err_code = sandbox::CreateRestrictedToken(token_type,
|
| + err_code = sandbox::CreateRestrictedToken(&token_handle_, token_type,
|
| sandbox::INTEGRITY_LEVEL_LAST,
|
| - sandbox::PRIMARY, &token_handle_);
|
| + sandbox::PRIMARY);
|
| return err_code;
|
| }
|
|
|
| DWORD Finder::Scan() {
|
| - if (!token_handle_.IsValid()) {
|
| + if (!token_handle_) {
|
| return ERROR_NO_TOKEN;
|
| }
|
|
|
|
|