Bug 1062469 - Don't leak pluginLib in nsNPAPIPlugin error path. r=bsmedberg
authorJohn Schoenick <jschoenick@mozilla.com>
Tue, 25 Feb 2014 15:55:07 -0800
changeset 203454 e4d598b3b5160b1c1d0b9101c4477876a86493ed
parent 203453 fb92ec3cabb1af658d5d322688d131601dff0f5b
child 203455 55f0e713ff428359ff717943d27d71c41b4ab080
push id27428
push usercbook@mozilla.com
push dateThu, 04 Sep 2014 13:00:04 +0000
treeherdermozilla-central@7bfd030e8fc8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1062469
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1062469 - Don't leak pluginLib in nsNPAPIPlugin error path. r=bsmedberg
dom/plugins/base/nsNPAPIPlugin.cpp
--- a/dom/plugins/base/nsNPAPIPlugin.cpp
+++ b/dom/plugins/base/nsNPAPIPlugin.cpp
@@ -414,16 +414,17 @@ nsNPAPIPlugin::CreatePlugin(nsPluginTag 
   PluginLibrary* pluginLib = GetNewPluginLibrary(aPluginTag);
   if (!pluginLib) {
     return NS_ERROR_FAILURE;
   }
 
 #if defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID)
   if (!pluginLib->HasRequiredFunctions()) {
     NS_WARNING("Not all necessary functions exposed by plugin, it will not load.");
+    delete pluginLib;
     return NS_ERROR_FAILURE;
   }
 #endif
 
   plugin->mLibrary = pluginLib;
   pluginLib->SetPlugin(plugin);
 
   NPError pluginCallError;