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

Unified Diff: chrome/browser/policy/policy_loader_win.cc

Issue 10830022: Fixed check return warnings from Coverity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/policy_loader_win.cc
diff --git a/chrome/browser/policy/policy_loader_win.cc b/chrome/browser/policy/policy_loader_win.cc
index 36a44fea38450e53e1a55832ad4f4d7e2a503c2f..17be5d2902efb2a29f914e5c5b9b149bf5083fd8 100644
--- a/chrome/browser/policy/policy_loader_win.cc
+++ b/chrome/browser/policy/policy_loader_win.cc
@@ -88,7 +88,8 @@ bool LoadHighestPriorityKey(const string16& key_path,
string16 path(kKeyPaths[k].path);
if (!key_path.empty())
path += kPathSep + key_path;
- key->Open(kHives[h].hive, path.c_str(), KEY_READ);
+ LONG rc = key->Open(kHives[h].hive, path.c_str(), KEY_READ);
+ DCHECK_EQ(rc, ERROR_SUCCESS);
Mattias Nissler (ping if slow) 2012/07/26 09:37:06 I think this is also wrong. Keys may not exist, so
Joao da Silva 2012/07/26 10:04:33 Yep. Rewrite as: if (key->Open(...) != ERROR_SUCC
Danh Nguyen 2012/07/26 15:46:27 Fixed per Joao's advice. Thanks.
if (!key->Valid())
continue;
if (value_name.empty() || key->HasValue(value_name.c_str())) {

Powered by Google App Engine
This is Rietveld 408576698