summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstritar@chromium.org <jstritar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-05 21:17:23 +0000
committerjstritar@chromium.org <jstritar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-05 21:17:23 +0000
commit24324927e9d4d3f4d2ad3f5d4f6ee8918d10d2ea (patch)
tree8d5519b9f4f28fea80a7d64392159fe0d68cf436
parentc54ab233b57b0c0cab2b814ef915767cece172bd (diff)
downloadchromium_src-24324927e9d4d3f4d2ad3f5d4f6ee8918d10d2ea.zip
chromium_src-24324927e9d4d3f4d2ad3f5d4f6ee8918d10d2ea.tar.gz
chromium_src-24324927e9d4d3f4d2ad3f5d4f6ee8918d10d2ea.tar.bz2
Fix Manifest leak in Extension::InitFromValue.
Extension::InitFromValue was leaking Manifest objects when returning early from error conditions. BUG=106331 TEST=existing Review URL: http://codereview.chromium.org/8805010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113024 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/extensions/extension.cc3
-rw-r--r--tools/heapcheck/suppressions.txt27
-rw-r--r--tools/valgrind/memcheck/suppressions.txt6
3 files changed, 1 insertions, 35 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 1e84be7..1690e44 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -1385,6 +1385,7 @@ bool Extension::InitFromValue(extensions::Manifest* manifest, int flags,
std::string* error) {
DCHECK(error);
base::AutoLock auto_lock(runtime_data_lock_);
+ manifest_.reset(manifest);
if (!manifest->ValidateManifest(error))
return false;
@@ -1446,8 +1447,6 @@ bool Extension::InitFromValue(extensions::Manifest* manifest, int flags,
creation_flags_ = flags;
- manifest_.reset(manifest);
-
// Initialize the URL.
extension_url_ = Extension::GetBaseURLFromExtensionId(id());
diff --git a/tools/heapcheck/suppressions.txt b/tools/heapcheck/suppressions.txt
index dc96174..fa90381 100644
--- a/tools/heapcheck/suppressions.txt
+++ b/tools/heapcheck/suppressions.txt
@@ -1785,30 +1785,3 @@
fun:AccessibilityEventRouterViewsTest::CreateWindowWithContents
fun:AccessibilityEventRouterViewsTest_TestFocusNotification_Test::TestBody
}
-{
- bug_106331_a
- Heapcheck:Leak
- ...
- fun:Extension::Create
-}
-{
- bug_106331_b
- Heapcheck:Leak
- ...
- fun:ExtensionUnpacker::ReadManifest
- fun:ExtensionUnpacker::Run
-}
-{
- bug_106331_c
- Heapcheck:Leak
- ...
- fun:JSONFileValueSerializer::Deserialize
- fun:::FileThreadDeserializer::DoReading
- fun:JsonPrefStore::ReadPrefs
- fun:PrefService::InitFromStorage
- fun:PrefService*
- fun:PrefServiceMockBuilder::Create
- fun:ExtensionServiceTestBase::InitializeExtensionService
- fun:ExtensionServiceTestBase::InitializeInstalledExtensionService
- fun:ExtensionServiceTest_UninstallingNotLoadedExtension_Test::TestBody
-}
diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt
index a204c35..1bfe760 100644
--- a/tools/valgrind/memcheck/suppressions.txt
+++ b/tools/valgrind/memcheck/suppressions.txt
@@ -5323,12 +5323,6 @@
fun:_ZN7WebCoreL17executeInsertHTMLEPNS_5FrameEPNS_5EventENS_19EditorCommandSourceERKN3WTF6StringE
}
{
- bug_106331
- Memcheck:Leak
- ...
- fun:_ZN9Extension6CreateERK8FilePathNS_8LocationERKN4base15DictionaryValueEiPSs
-}
-{
bug_106402
Memcheck:Leak
fun:_Znw*