coverity#983009: Resource leak
Just moving pArr block should be ok Change-Id: I9c5c4c35b90d8f06933521c77c966a426a801cec
This commit is contained in:
committed by
Caolán McNamara
parent
1d6b17d613
commit
17f68a9ea1
@@ -310,6 +310,10 @@ int TxtBox::Read(HWPFile & hwpf)
|
|||||||
hwpf.ReadParaList(caption);
|
hwpf.ReadParaList(caption);
|
||||||
|
|
||||||
if( type == 0 ){ // if table?
|
if( type == 0 ){ // if table?
|
||||||
|
TCell* *pArr = ::comphelper::newArray_null<TCell *>(ncell);
|
||||||
|
if (!pArr) {
|
||||||
|
return hwpf.SetState(HWP_InvalidFileFormat);
|
||||||
|
}
|
||||||
Table *tbl = new Table;
|
Table *tbl = new Table;
|
||||||
for( ii = 0 ; ii < ncell; ii++)
|
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);
|
||||||
tbl->rows.insert(cell[ii].y + cell[ii].h);
|
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++)
|
for( ii = 0 ; ii < ncell; ii++)
|
||||||
{
|
{
|
||||||
TCell *tcell = new TCell;
|
TCell *tcell = new TCell;
|
||||||
|
Reference in New Issue
Block a user