coverity#1190359 Resource leak

Change-Id: Ia1e26fbc34abf4a47a45dbfb5c24ed64b77703d3
This commit is contained in:
Caolán McNamara
2014-03-06 10:52:11 +00:00
parent c71de82e9a
commit c105ec2f0e

View File

@@ -1356,6 +1356,7 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat
bool bCreateNativeLink = true;
sal_uInt8* pGraphicContent = NULL;
bool bGraphicContentOwned = true;
sal_Int32 nGraphicContentSize = 0;
ResetLastError();
@@ -1774,13 +1775,14 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat
}
}
if( nStatus == GRFILTER_OK )
{
rGraphic.SetLink( GfxLink( pGraphicContent, nGraphicContentSize, eLinkType, true ) );
bGraphicContentOwned = false; //ownership passed to the GfxLink
}
}
else
{
if(nGraphicContentSize > 0)
delete[] pGraphicContent;
}
if (bGraphicContentOwned)
delete[] pGraphicContent;
// Set error code or try to set native buffer
if( nStatus != GRFILTER_OK )