diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2013-03-04 21:16:21 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-03-06 14:18:21 +0000 |
commit | 17f68a9ea17f42757a124651a86bb04ee57f34f9 (patch) | |
tree | 2784865f873d8dea23a521d2db155ae7eb9cc2e9 | |
parent | 1d6b17d6130f0bb24c19207dffebe17f983d3415 (diff) |
coverity#983009: Resource leak
Just moving pArr block should be ok
Change-Id: I9c5c4c35b90d8f06933521c77c966a426a801cec
-rw-r--r-- | hwpfilter/source/hwpread.cxx | 8 |
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; |