summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-08-12 21:25:25 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-12-05 08:17:25 -0500
commitbee92c6f9c42336dc4ae0b26dcc20b3d6c2ab3fe (patch)
treec7d2c5ad7dd34f81a76ee855fd82e8d50fd49e9d
parent4078977daa14c0c50baf0acfe2028e6551ab2278 (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> (cherry picked from commit 68b0a61f7d4f89fd25b7725830b828c821da7dad) (cherry picked from commit 09d6dcc120902213cce7c3ebce84f0f0551c2fd8)
-rw-r--r--vcl/source/gdi/bitmapex.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index b93643fa581f..f8def3cdc1b8 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -796,14 +796,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) );
@@ -811,6 +812,7 @@ bool BitmapEx::Create( const css::uno::Reference< css::rendering::XBitmapCanvas
}
else
{
+ delete pSalMask;
*this = BitmapEx(Bitmap(pSalBmp));
return true;
}