summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2013-03-04 21:16:21 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-03-06 14:18:21 +0000
commit17f68a9ea17f42757a124651a86bb04ee57f34f9 (patch)
tree2784865f873d8dea23a521d2db155ae7eb9cc2e9 /hwpfilter
parent1d6b17d6130f0bb24c19207dffebe17f983d3415 (diff)
coverity#983009: Resource leak
Just moving pArr block should be ok Change-Id: I9c5c4c35b90d8f06933521c77c966a426a801cec
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/hwpread.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx
index 325f74c5d358..becdb76773a6 100644
--- a/hwpfilter/source/hwpread.cxx
+++ b/hwpfilter/source/hwpread.cxx
@@ -310,6 +310,10 @@ int TxtBox::Read(HWPFile & hwpf)
hwpf.ReadParaList(caption);
if( type == 0 ){ // if table?
+ TCell* *pArr = ::comphelper::newArray_null<TCell *>(ncell);
+ if (!pArr) {
+ return hwpf.SetState(HWP_InvalidFileFormat);
+ }
Table *tbl = new Table;
for( ii = 0 ; ii < ncell; ii++)
{
@@ -318,10 +322,6 @@ int TxtBox::Read(HWPFile & hwpf)
tbl->rows.insert(cell[ii].y);
tbl->rows.insert(cell[ii].y + cell[ii].h);
}
- TCell* *pArr = ::comphelper::newArray_null<TCell *>(ncell);
- if (!pArr) {
- return hwpf.SetState(HWP_InvalidFileFormat);
- }
for( ii = 0 ; ii < ncell; ii++)
{
TCell *tcell = new TCell;