[Libreoffice-commits] .: sw/source

Lubos Lunak llunak at kemper.freedesktop.org
Mon Apr 2 06:25:48 PDT 2012


 sw/source/filter/ww8/ww8par.cxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 3bbe44404f0ff98dbbaeb3d1b3adaede9c27b1a5
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Mon Apr 2 15:21:38 2012 +0200

    prevent a memory leak
    
    Based on a patch from Arnaud Versini
    (http://lists.freedesktop.org/archives/libreoffice/2012-April/029240.html)

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 541adc8..6fe9784 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2716,6 +2716,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs)
         pStr->length = nEndUsed;
 
         emulateMSWordAddTextToParagraph(rtl::OUString(pStr, SAL_NO_ACQUIRE));
+        pStr = NULL;
         rPos += nL2;
         if (!maApos.back()) //a para end in apo doesn't count
             bWasParaEnd = false;            //kein CR
@@ -2723,6 +2724,8 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs)
 
     if (hConverter)
         rtl_destroyTextToUnicodeConverter(hConverter);
+    if (pStr)
+        rtl_uString_release(pStr);
     delete [] p8Bits;
     return nL2 >= nStrLen;
 }


More information about the Libreoffice-commits mailing list