diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-04-02 15:21:38 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-04-02 15:24:59 +0200 |
commit | 3bbe44404f0ff98dbbaeb3d1b3adaede9c27b1a5 (patch) | |
tree | 3c28bb94940181a1e6af3b754da7312bd89f50a4 | |
parent | 9a6f7f674be0a3b82bc82a78737178326d622268 (diff) |
prevent a memory leak
Based on a patch from Arnaud Versini
(http://lists.freedesktop.org/archives/libreoffice/2012-April/029240.html)
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 3 |
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; } |