[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:43:30 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit ad594d06266c5ab488f22768d03e72fa91589ce6
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu May 29 22:42:30 2003 +0000

    	Fixed: 3273109 - leak from functionPointerForTVector in -[WebNetscapePluginPackage load]
    
            * Plugins.subproj/WebNetscapePluginPackage.m:
            (-[WebNetscapePluginPackage load]): free the main function after using it
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4448 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 8fd1567..2e17f58 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,10 @@
+2003-05-29  Chris Blumenberg  <cblu at apple.com>
+
+	Fixed: 3273109 - leak from functionPointerForTVector in -[WebNetscapePluginPackage load]
+
+        * Plugins.subproj/WebNetscapePluginPackage.m:
+        (-[WebNetscapePluginPackage load]): free the main function after using it
+
 2003-05-29  Richard Williamson   <rjw at apple.com>
 	
 	Fixed 3273115.  Always use pixel dimensions,
diff --git a/WebKit/Plugins.subproj/WebNetscapePluginPackage.m b/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
index 9538c4d..ab103de 100644
--- a/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
+++ b/WebKit/Plugins.subproj/WebNetscapePluginPackage.m
@@ -376,7 +376,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
         
         if (isCFM) {
             pluginMainFunc = (MainFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("main") );
-            if(!pluginMainFunc) {
+            if (!pluginMainFunc) {
                 goto abort;
             }
         } else {
@@ -419,7 +419,9 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
         if (!pluginMainFunc) {
             goto abort;
         }
-            
+
+        // NOTE: pluginMainFunc is freed after it is called. Be sure not to return before that.
+        
         isCFM = TRUE;
     }
     
@@ -460,6 +462,11 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
 #endif
         LOG(Plugins, "%f main timing started", mainStart);
         npErr = pluginMainFunc(&browserFuncs, &pluginFuncs, &NPP_Shutdown);
+        if (!isBundle) {
+            // Don't free pluginMainFunc if we got it from a bundle because it is owned by CFBundle in that case.
+            free(pluginMainFunc);
+        }
+        
         // Workaround for 3270576. The RealPlayer plug-in fails to load if its preference file is out of date.
         // Launch the RealPlayer application to refresh the file.
         if (npErr != NPERR_NO_ERROR) {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list