From 17f68a9ea17f42757a124651a86bb04ee57f34f9 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Mon, 4 Mar 2013 21:16:21 +0100 Subject: coverity#983009: Resource leak Just moving pArr block should be ok Change-Id: I9c5c4c35b90d8f06933521c77c966a426a801cec --- hwpfilter/source/hwpread.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'hwpfilter/source/hwpread.cxx') 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(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(ncell); - if (!pArr) { - return hwpf.SetState(HWP_InvalidFileFormat); - } for( ii = 0 ; ii < ncell; ii++) { TCell *tcell = new TCell; -- cgit