Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Unified Diff: content/renderer/pepper/plugin_object.cc

Issue 1805303002: Ensure that the ppp_class_data is freed when a PluginObject isn't created (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/plugin_object.cc
diff --git a/content/renderer/pepper/plugin_object.cc b/content/renderer/pepper/plugin_object.cc
index d6023fff08d2a24f8032fbba5752268c5af7923d..2c1f91cb9aee8f7893b970aee0ca009d1cf4003f 100644
--- a/content/renderer/pepper/plugin_object.cc
+++ b/content/renderer/pepper/plugin_object.cc
@@ -79,8 +79,10 @@ PP_Var PluginObject::Create(PepperPluginInstanceImpl* instance,
// If the V8 context is empty, we may be in the process of tearing down the
// frame and may not have a valid isolate (in particular due to re-entrancy).
// We shouldn't try to call gin::CreateHandle.
- if (try_catch.GetContext().IsEmpty())
+ if (try_catch.GetContext().IsEmpty()) {
+ ppp_class->Deallocate(ppp_class_data);
return PP_MakeUndefined();
+ }
gin::Handle<PluginObject> object =
gin::CreateHandle(instance->GetIsolate(),
new PluginObject(instance, ppp_class, ppp_class_data));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698