Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2550

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/50/2550/1

coverity#983009: Resource leak

Just moving pArr block should be ok

Change-Id: I9c5c4c35b90d8f06933521c77c966a426a801cec
---
M hwpfilter/source/hwpread.cxx
1 file changed, 4 insertions(+), 4 deletions(-)



diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx
index 325f74c..becdb76 100644
--- a/hwpfilter/source/hwpread.cxx
+++ b/hwpfilter/source/hwpread.cxx
@@ -310,6 +310,10 @@
     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++)
           {
@@ -317,10 +321,6 @@
                 tbl->columns.insert(cell[ii].x + cell[ii].w);
                 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++)
           {

-- 
To view, visit https://gerrit.libreoffice.org/2550
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9c5c4c35b90d8f06933521c77c966a426a801cec
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Julien Nabet <serval2412@yahoo.fr>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.