diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-08-12 21:25:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-13 12:15:35 +0200 |
commit | 68b0a61f7d4f89fd25b7725830b828c821da7dad (patch) | |
tree | aca25b26a1eb5f7da26efb9d14e7fed3d486a55a | |
parent | 1a6d617136941f5aab6d49c883f80fb62512f54d (diff) |
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@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | vcl/source/gdi/bitmapex.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 31da4bbff58c..99186cf04129 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -788,14 +788,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) ); @@ -803,6 +804,7 @@ bool BitmapEx::Create( const css::uno::Reference< css::rendering::XBitmapCanvas } else { + delete pSalMask; *this = BitmapEx(Bitmap(pSalBmp)); return true; } |