summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-04-02 15:21:38 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-04-02 15:24:59 +0200
commit3bbe44404f0ff98dbbaeb3d1b3adaede9c27b1a5 (patch)
tree3c28bb94940181a1e6af3b754da7312bd89f50a4 /sw
parent9a6f7f674be0a3b82bc82a78737178326d622268 (diff)
prevent a memory leak
Based on a patch from Arnaud Versini (http://lists.freedesktop.org/archives/libreoffice/2012-April/029240.html)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8par.cxx3
1 files changed, 3 insertions, 0 deletions
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;
}