From 0b1b7b517b51de436027ffcaf0e37334b623ddd2 Mon Sep 17 00:00:00 2001
From: Arnaud Versini <arnaud.versini@gmail.com>
Date: Sun, 1 Apr 2012 15:44:37 +0200
Subject: [PATCH] Fix memory leak in  SwWW8ImplReader::ReadPlainChars

---
 sw/source/filter/ww8/ww8par.cxx |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

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

