diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-09-10 20:32:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-10 20:32:36 +0100 |
commit | 890a48813134a43de31afd8ac3939fa454b610fe (patch) | |
tree | abfb02d7556067ab983f4ace03e185d4627c35eb /lotuswordpro/source | |
parent | 2e96061e6d796110ea74513b71aee560ac01cd57 (diff) |
CID#736398 resource leak
Change-Id: Ie1fc0aa191950bdf26fd376ec1e2c8ae69acde83
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r-- | lotuswordpro/source/filter/lwptable.cxx | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/lotuswordpro/source/filter/lwptable.cxx b/lotuswordpro/source/filter/lwptable.cxx index a8d328cfa53a..1a3022fb97a9 100644 --- a/lotuswordpro/source/filter/lwptable.cxx +++ b/lotuswordpro/source/filter/lwptable.cxx @@ -197,7 +197,6 @@ void LwpGlossary::Read() sal_uInt16 FiledEntries = m_pObjStrm->QuickReaduInt16(); sal_uInt16 NumIndexRows = GetNumIndexRows(); - sal_uInt16 * cpIndex = NULL; if (FiledEntries < NumIndexRows) { /* We'll have to do sequential (slow) searches. */ @@ -207,23 +206,13 @@ void LwpGlossary::Read() { if (NumIndexRows) { - sal_uInt16 EntriesRead, EntryCount; - sal_uInt16 *pRowID; + sal_uInt16 EntriesRead = (FiledEntries > NumIndexRows)? NumIndexRows:FiledEntries; - cpIndex = new sal_uInt16[NumIndexRows]; + for (sal_uInt16 EntryCount = 1; EntryCount <= EntriesRead; EntryCount++) + m_pObjStrm->QuickReaduInt16(); - if (cpIndex) - { - pRowID = cpIndex; - - EntriesRead = (FiledEntries > NumIndexRows)? NumIndexRows:FiledEntries; - - for (EntryCount = 1; EntryCount <= EntriesRead; EntryCount++) - *pRowID++ = m_pObjStrm->QuickReaduInt16(); - - if (FiledEntries > EntriesRead) - m_pObjStrm->SeekRel((FiledEntries - EntriesRead)* sizeof(sal_uInt16)); - } + if (FiledEntries > EntriesRead) + m_pObjStrm->SeekRel((FiledEntries - EntriesRead)* sizeof(sal_uInt16)); } else m_pObjStrm->SeekRel(FiledEntries * sizeof(sal_uInt16)); |