summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-30 10:09:55 +0000
committerkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-30 10:09:55 +0000
commit1aec9a0131352882152eb788a674f8c08eda4679 (patch)
treea8b45daf97e52a332023f14430e867e80dcba697
parentcefa7a4217bd971d2d8b82f55ba4abc0cee04443 (diff)
downloadchromium_src-1aec9a0131352882152eb788a674f8c08eda4679.zip
chromium_src-1aec9a0131352882152eb788a674f8c08eda4679.tar.gz
chromium_src-1aec9a0131352882152eb788a674f8c08eda4679.tar.bz2
Fix memory leak in V8ValueConverterImpl that I just introduced.
TBR=jam@chromium.org BUG=129411 Review URL: https://chromiumcodereview.appspot.com/10442082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139518 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/renderer/v8_value_converter_impl.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/content/renderer/v8_value_converter_impl.cc b/content/renderer/v8_value_converter_impl.cc
index a21c4f0..15a3ca4 100644
--- a/content/renderer/v8_value_converter_impl.cc
+++ b/content/renderer/v8_value_converter_impl.cc
@@ -279,7 +279,7 @@ base::BinaryValue* V8ValueConverterImpl::FromV8Buffer(
DictionaryValue* V8ValueConverterImpl::FromV8Object(
v8::Handle<v8::Object> val) const {
- DictionaryValue* result = new DictionaryValue();
+ scoped_ptr<DictionaryValue> result(new DictionaryValue());
v8::Handle<v8::Array> property_names(val->GetPropertyNames());
for (uint32 i = 0; i < property_names->Length(); ++i) {
v8::Handle<v8::String> name(property_names->Get(i).As<v8::String>());
@@ -299,8 +299,8 @@ DictionaryValue* V8ValueConverterImpl::FromV8Object(
child_v8 = v8::Null();
}
- Value* child = FromV8ValueImpl(child_v8);
- CHECK(child);
+ scoped_ptr<Value> child(FromV8ValueImpl(child_v8));
+ CHECK(child.get());
// Strip null if asked (and since undefined is turned into null, undefined
// too). The use case for supporting this is JSON-schema support,
@@ -326,7 +326,7 @@ DictionaryValue* V8ValueConverterImpl::FromV8Object(
continue;
result->SetWithoutPathExpansion(std::string(*name_utf8, name_utf8.length()),
- child);
+ child.release());
}
- return result;
+ return result.release();
}