diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-21 22:12:58 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-21 22:12:58 +0000 |
commit | a1923e617066da321821a8ccbdf0fbadd77d80de (patch) | |
tree | b9d584225fb0ecd77e49493da2d6f80fd4a44186 /ppapi | |
parent | b61c145d0b762e5ef324073091ba6a67f7fc71f0 (diff) | |
download | chromium_src-a1923e617066da321821a8ccbdf0fbadd77d80de.zip chromium_src-a1923e617066da321821a8ccbdf0fbadd77d80de.tar.gz chromium_src-a1923e617066da321821a8ccbdf0fbadd77d80de.tar.bz2 |
Coverity: Fix leaks.
CID=2168,8197,8198,100251,100256,100820,101011,101982,101983,101984,101988,
102256
BUG=none
TEST=none
R=dpapad
Review URL: http://codereview.chromium.org/8989036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115422 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/native_client/src/trusted/plugin/plugin.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc index d9743e8..331744c 100644 --- a/ppapi/native_client/src/trusted/plugin/plugin.cc +++ b/ppapi/native_client/src/trusted/plugin/plugin.cc @@ -24,6 +24,7 @@ #include <string> #include <vector> +#include "base/memory/scoped_ptr.h" #include "native_client/src/include/nacl_base.h" #include "native_client/src/include/nacl_macros.h" #include "native_client/src/include/nacl_scoped_ptr.h" @@ -900,7 +901,8 @@ bool Plugin::Init(uint32_t argc, const char* argn[], const char* argv[]) { HistogramEnumerateOsArch(GetSandboxISA()); init_time_ = NaClGetTimeOfDayMicroseconds(); - BrowserInterface* browser_interface = new(std::nothrow) BrowserInterface; + scoped_ptr<BrowserInterface> browser_interface( + new(std::nothrow) BrowserInterface); if (browser_interface == NULL) { return false; } @@ -919,7 +921,7 @@ bool Plugin::Init(uint32_t argc, const char* argn[], const char* argv[]) { static_cast<const void*>(url_util_))); bool status = Plugin::Init( - browser_interface, + browser_interface.release(), static_cast<int>(argc), // TODO(polina): Can we change the args on our end to be const to // avoid these ugly casts? |