Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(517)

Side by Side Diff: chrome/tools/crash_service/crash_service.cc

Issue 23441026: Don't check the result of new for NULL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/tools/crash_service/crash_service.h" 5 #include "chrome/tools/crash_service/crash_service.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <sddl.h> 9 #include <sddl.h>
10 #include <fstream> 10 #include <fstream>
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 if (cmd_line.HasSwitch(kPipeName)) 211 if (cmd_line.HasSwitch(kPipeName))
212 pipe_name = cmd_line.GetSwitchValueNative(kPipeName); 212 pipe_name = cmd_line.GetSwitchValueNative(kPipeName);
213 213
214 #ifdef _WIN64 214 #ifdef _WIN64
215 pipe_name += L"-x64"; 215 pipe_name += L"-x64";
216 #endif 216 #endif
217 217
218 if (max_reports > 0) { 218 if (max_reports > 0) {
219 // Create the http sender object. 219 // Create the http sender object.
220 sender_ = new CrashReportSender(checkpoint_path.value()); 220 sender_ = new CrashReportSender(checkpoint_path.value());
221 if (!sender_) {
222 LOG(ERROR) << "could not create sender";
223 return false;
224 }
225 sender_->set_max_reports_per_day(max_reports); 221 sender_->set_max_reports_per_day(max_reports);
226 } 222 }
227 223
228 SECURITY_ATTRIBUTES security_attributes = {0}; 224 SECURITY_ATTRIBUTES security_attributes = {0};
229 SECURITY_ATTRIBUTES* security_attributes_actual = NULL; 225 SECURITY_ATTRIBUTES* security_attributes_actual = NULL;
230 226
231 if (base::win::GetVersion() >= base::win::VERSION_VISTA) { 227 if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
232 SECURITY_DESCRIPTOR* security_descriptor = 228 SECURITY_DESCRIPTOR* security_descriptor =
233 reinterpret_cast<SECURITY_DESCRIPTOR*>( 229 reinterpret_cast<SECURITY_DESCRIPTOR*>(
234 GetSecurityDescriptorForLowIntegrity()); 230 GetSecurityDescriptorForLowIntegrity());
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 SDDL_REVISION, 494 SDDL_REVISION,
499 &sec_desc, NULL)) { 495 &sec_desc, NULL)) {
500 if (::GetSecurityDescriptorSacl(sec_desc, &sacl_present, &sacl, 496 if (::GetSecurityDescriptorSacl(sec_desc, &sacl_present, &sacl,
501 &sacl_defaulted)) { 497 &sacl_defaulted)) {
502 return sec_desc; 498 return sec_desc;
503 } 499 }
504 } 500 }
505 501
506 return NULL; 502 return NULL;
507 } 503 }
OLDNEW
« no previous file with comments | « no previous file | net/tools/crash_cache/crash_cache.cc » ('j') | net/tools/crash_cache/crash_cache.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698