coverity#983009: Resource leak

Just moving pArr block should be ok

Change-Id: I9c5c4c35b90d8f06933521c77c966a426a801cec
This commit is contained in:
Julien Nabet
2013-03-04 21:16:21 +01:00
committed by Caolán McNamara
parent 1d6b17d613
commit 17f68a9ea1

View File

@@ -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;