Fix a memory leak in chrome://version handler.

Found by the Mac OS X 'leaks' tool; fixed on a plane.

BUG=292905

Review URL: https://chromiumcodereview.appspot.com/23686018

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223554 0039d316-1c4b-4281-b951-d872f2087c98
parent 1655ad39
......@@ -85,7 +85,6 @@ void VersionHandler::HandleRequestVersionInfo(const ListValue* args) {
base::Owned(profile_path_buffer)));
// Respond with the variations info immediately.
scoped_ptr<ListValue> variations_list(new ListValue());
std::vector<std::string> variations;
#if !defined(NDEBUG)
base::FieldTrial::ActiveGroups active_groups;
......@@ -108,14 +107,14 @@ void VersionHandler::HandleRequestVersionInfo(const ListValue* args) {
variations.push_back(UTF16ToASCII(active_groups[i]));
#endif
ListValue variations_list;
for (std::vector<std::string>::const_iterator it = variations.begin();
it != variations.end(); ++it) {
variations_list->Append(Value::CreateStringValue(*it));
variations_list.Append(Value::CreateStringValue(*it));
}
// In release mode, this will return an empty list to clear the section.
web_ui()->CallJavascriptFunction("returnVariationInfo",
*variations_list.release());
web_ui()->CallJavascriptFunction("returnVariationInfo", variations_list);
}
void VersionHandler::OnGotFilePaths(string16* executable_path_data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment