[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - vcl/source

Julien Nabet serval2412 at yahoo.fr
Mon Aug 14 06:34:38 UTC 2017


 vcl/source/gdi/bitmapex.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit efbbf7fd668e189e41c80232e11185bfd25ee2a0
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Aug 12 21:25:25 2017 +0200

    Related tdf#101467: fix a leak with pSalMask (vcl/bitmapex)
    
    + initialize pSalBmp+pSalMask to nullptr
    
    Change-Id: I320e9cf98ef8224e98303bec1e58f59dc5b1ad4e
    Reviewed-on: https://gerrit.libreoffice.org/41097
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit 68b0a61f7d4f89fd25b7725830b828c821da7dad)
    Reviewed-on: https://gerrit.libreoffice.org/41109
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index a2034944ae88..fc75f9e5b120 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -787,14 +787,15 @@ bool BitmapEx::Create( const css::uno::Reference< css::rendering::XBitmapCanvas
         }
     }
 
-    SalBitmap* pSalBmp, *pSalMask;
+    SalBitmap* pSalBmp = nullptr;
+    SalBitmap* pSalMask = nullptr;
 
     pSalBmp = ImplGetSVData()->mpDefInst->CreateSalBitmap();
-    pSalMask = ImplGetSVData()->mpDefInst->CreateSalBitmap();
 
     Size aLocalSize(rSize);
     if( pSalBmp->Create( xBitmapCanvas, aLocalSize ) )
     {
+        pSalMask = ImplGetSVData()->mpDefInst->CreateSalBitmap();
         if ( pSalMask->Create( xBitmapCanvas, aLocalSize, true ) )
         {
             *this = BitmapEx(Bitmap(pSalBmp), Bitmap(pSalMask) );
@@ -802,6 +803,7 @@ bool BitmapEx::Create( const css::uno::Reference< css::rendering::XBitmapCanvas
         }
         else
         {
+            delete pSalMask;
             *this = BitmapEx(Bitmap(pSalBmp));
             return true;
         }


More information about the Libreoffice-commits mailing list