8 bytes memory leaks in WebProcessMainQt.cpp when proxy is initialized
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Sep 2013 06:33:18 +0000 (06:33 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Sep 2013 06:33:18 +0000 (06:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=118515

Patch by Minju Kim <pmuarteo@gmail.com> on 2013-09-25
Reviewed by Christophe Dumez.

* WebProcess/qt/WebProcessMainQt.cpp:
(WebKit::initializeProxy): Handled EnvHttpProxyFactory by using OwnPtr
to avoid memory leak when it isn't handled by NetworkProxyFactory

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156449 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp

index 79bf7f5501a408adc9cdf88f7c13374358589986..9d7ae26e24b746e88455703a5c2d84404f5b3f60 100644 (file)
@@ -1,3 +1,14 @@
+2013-09-25  Minju Kim  <pmuarteo@gmail.com>
+
+        8 bytes memory leaks in WebProcessMainQt.cpp when proxy is initialized
+        https://bugs.webkit.org/show_bug.cgi?id=118515
+
+        Reviewed by Christophe Dumez.
+
+        * WebProcess/qt/WebProcessMainQt.cpp:
+        (WebKit::initializeProxy): Handled EnvHttpProxyFactory by using OwnPtr
+        to avoid memory leak when it isn't handled by NetworkProxyFactory
+
 2013-09-25  Brady Eidson  <beidson@apple.com>
 
         Enable the IndexedDB build on Mac, but leave the feature non-functional
index ccd93a97f79ea098529a91b8a463105453cfae54..474b6c6fe57fdea4b42a77a001ee46405a19b0f7 100644 (file)
@@ -132,9 +132,9 @@ static void initializeProxy()
     if (proxylist.count() == 1) {
         QNetworkProxy proxy = proxylist.first();
         if (proxy == QNetworkProxy::NoProxy || proxy == QNetworkProxy::DefaultProxy) {
-            EnvHttpProxyFactory* proxyFactory = new EnvHttpProxyFactory();
+            OwnPtr<EnvHttpProxyFactory> proxyFactory = adoptPtr(new EnvHttpProxyFactory());
             if (proxyFactory->initializeFromEnvironment()) {
-                QNetworkProxyFactory::setApplicationProxyFactory(proxyFactory);
+                QNetworkProxyFactory::setApplicationProxyFactory(proxyFactory.leakPtr());
                 return;
             }
         }