Title: [103358] trunk/Source/WebCore
Revision
103358
Author
[email protected]
Date
2011-12-20 15:46:03 -0800 (Tue, 20 Dec 2011)

Log Message

[Coverity] Fix leak in V8HTMLDocument
https://bugs.webkit.org/show_bug.cgi?id=74943

Patch by Greg Billock <[email protected]> on 2011-12-20
Reviewed by Adam Barth.

* bindings/v8/custom/V8HTMLDocumentCustom.cpp:
(WebCore::V8HTMLDocument::openCallback):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (103357 => 103358)


--- trunk/Source/WebCore/ChangeLog	2011-12-20 23:39:54 UTC (rev 103357)
+++ trunk/Source/WebCore/ChangeLog	2011-12-20 23:46:03 UTC (rev 103358)
@@ -1,3 +1,13 @@
+2011-12-20  Greg Billock  <[email protected]>
+
+        [Coverity] Fix leak in V8HTMLDocument
+        https://bugs.webkit.org/show_bug.cgi?id=74943
+
+        Reviewed by Adam Barth.
+
+        * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+        (WebCore::V8HTMLDocument::openCallback):
+
 2011-12-20  Sailesh Agrawal <[email protected]>
 
         Merge ScrollAnimatorChromiumMac.mm back to ScrollAnimatorMac

Modified: trunk/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp (103357 => 103358)


--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp	2011-12-20 23:39:54 UTC (rev 103357)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp	2011-12-20 23:46:03 UTC (rev 103358)
@@ -44,6 +44,7 @@
 #include "V8IsolatedContext.h"
 #include "V8Node.h"
 #include "V8Proxy.h"
+#include <wtf/OwnArrayPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/StdLibExtras.h>
 
@@ -147,7 +148,7 @@
                 return v8::Undefined();
             }
             // Wrap up the arguments and call the function.
-            v8::Local<v8::Value>* params = new v8::Local<v8::Value>[args.Length()];
+            OwnArrayPtr<v8::Local<v8::Value> > params = adoptArrayPtr(new v8::Local<v8::Value>[args.Length()]);
             for (int i = 0; i < args.Length(); i++)
                 params[i] = args[i];
 
@@ -155,8 +156,7 @@
             if (!proxy)
                 return v8::Undefined();
 
-            v8::Local<v8::Value> result = proxy->callFunction(v8::Local<v8::Function>::Cast(function), global, args.Length(), params);
-            delete[] params;
+            v8::Local<v8::Value> result = proxy->callFunction(v8::Local<v8::Function>::Cast(function), global, args.Length(), params.get());
             return result;
         }
     }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to