From 3bbe44404f0ff98dbbaeb3d1b3adaede9c27b1a5 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Mon, 2 Apr 2012 15:21:38 +0200 Subject: prevent a memory leak Based on a patch from Arnaud Versini (http://lists.freedesktop.org/archives/libreoffice/2012-April/029240.html) --- sw/source/filter/ww8/ww8par.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sw') diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 541adc83928f..6fe97846b70f 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; } -- cgit