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

Unified Diff: base/json/json_parser.cc

Issue 10386168: Fix a leak in JSONParser::Parse when using hidden root optimizations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_parser.cc
diff --git a/base/json/json_parser.cc b/base/json/json_parser.cc
index 766c764a2c4c4ae0239e48a0f3afdf2fa02aa728..d1bba4464b1dfd6ee6d9f891bca8312b8c09adb3 100644
--- a/base/json/json_parser.cc
+++ b/base/json/json_parser.cc
@@ -258,9 +258,9 @@ Value* JSONParser::Parse(const std::string& input) {
// hidden root.
if (!(options_ & JSON_DETACHABLE_CHILDREN)) {
if (root->IsType(Value::TYPE_DICTIONARY)) {
- return new DictionaryHiddenRootValue(&input_copy, root.release());
+ return new DictionaryHiddenRootValue(&input_copy, root.get());
} else if (root->IsType(Value::TYPE_LIST)) {
- return new ListHiddenRootValue(&input_copy, root.release());
+ return new ListHiddenRootValue(&input_copy, root.get());
} else if (root->IsType(Value::TYPE_STRING)) {
// A string type could be a JSONStringValue, but because there's no
// corresponding HiddenRootValue, the memory will be lost. Deep copy to
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698