summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-08-08 15:19:59 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-08-08 15:19:59 +0100
commit0633acb6512debb4a7af8ae2d249bfb8b2551c8b (patch)
tree25dec6541fe5f720d41f452f68b47b42e6c343b8 /sw/source
parentaf6f8242ea9b61841f3be23fc5eaca4da79e264a (diff)
valgrind: leak on early return branch
Change-Id: I05cdd55ff22f845fc9210e8eeb2bdcf5a2a8103d
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 0e3b08a87670..a4336b9f5a18 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -26,7 +26,7 @@
*
************************************************************************/
-
+#include <boost/scoped_ptr.hpp>
#include <tools/solar.h>
#include <vcl/vclenum.hxx>
#include <vcl/font.hxx>
@@ -3915,20 +3915,20 @@ void WW8RStyle::Import1Style( sal_uInt16 nNr )
short nSkip, cbStd;
String sName;
- WW8_STD* pStd = Read1Style( nSkip, &sName, &cbStd );// lies Style
+ boost::scoped_ptr<WW8_STD> xStd(Read1Style(nSkip, &sName, &cbStd));// lies Style
- if (pStd)
- rSI.SetOrgWWIdent( sName, pStd->sti );
+ if (xStd)
+ rSI.SetOrgWWIdent( sName, xStd->sti );
// either no Name or unused Slot or unknown Style
- if ( !pStd || (0 == sName.Len()) || ((1 != pStd->sgc) && (2 != pStd->sgc)) )
+ if ( !xStd || (0 == sName.Len()) || ((1 != xStd->sgc) && (2 != xStd->sgc)) )
{
pStStrm->SeekRel( nSkip );
return;
}
- bool bOldNoImp = PrepareStyle(rSI, static_cast<ww::sti>(pStd->sti), nNr, pStd->istdNext);
+ bool bOldNoImp = PrepareStyle(rSI, static_cast<ww::sti>(xStd->sti), nNr, xStd->istdNext);
// falls etwas falsch interpretiert wird, gehts danach wieder richtig
long nPos = pStStrm->Tell();
@@ -3940,12 +3940,11 @@ void WW8RStyle::Import1Style( sal_uInt16 nNr )
//offset
//Import of the Style Contents
- ImportGrupx(nSkip, pStd->sgc == 1, rSI.nFilePos & 1);
+ ImportGrupx(nSkip, xStd->sgc == 1, rSI.nFilePos & 1);
PostStyle(rSI, bOldNoImp);
pStStrm->Seek( nPos+nSkip );
- delete pStd;
}
void WW8RStyle::RecursiveReg(sal_uInt16 nNr)