summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2011-04-26 12:56:44 +0200
committerDavid Tardon <dtardon@redhat.com>2011-04-26 12:56:44 +0200
commita6cedff9ec288cc371f37f3dba48f506ab2cf9d9 (patch)
treedc17cfb2cb3810c72520b5614da5c0938ee4c304 /lotuswordpro
parentd4188de23f9e6cb9405a07ea8bd0ce3ad326e99f (diff)
do not leak memory
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwpgrfobj.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx b/lotuswordpro/source/filter/lwpgrfobj.cxx
index 83a3a1f3b9cf..9d344447d035 100644
--- a/lotuswordpro/source/filter/lwpgrfobj.cxx
+++ b/lotuswordpro/source/filter/lwpgrfobj.cxx
@@ -63,6 +63,9 @@
* For LWP filter architecture prototype
*/
#include <stdio.h>
+
+#include <boost/scoped_ptr.hpp>
+
#include "lwp9reader.hxx"
#include "lwpgrfobj.hxx"
#include "lwpsdwfileloader.hxx"
@@ -435,10 +438,14 @@ sal_uInt32 LwpGraphicObject::GetRawGrafData(sal_uInt8*& pGrafData)
// if small file, use the compressed stream for BENTO
LwpSvStream* pStream = m_pStrm->GetCompressedStream() ? m_pStrm->GetCompressedStream(): m_pStrm;
- OpenStormBento::LtcBenContainer* pBentoContainer;
- sal_uLong ulRet = OpenStormBento::BenOpenContainer(pStream, &pBentoContainer);
- if (ulRet != OpenStormBento::BenErr_OK)
- return 0;
+ boost::scoped_ptr<OpenStormBento::LtcBenContainer> pBentoContainer;
+ {
+ OpenStormBento::LtcBenContainer* pTmp(0);
+ sal_uLong ulRet = OpenStormBento::BenOpenContainer(pStream, &pTmp);
+ pBentoContainer.reset(pTmp);
+ if (ulRet != OpenStormBento::BenErr_OK)
+ return 0;
+ }
SvStream* pGrafStream = NULL;