[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - bridges/source

Julien Nabet serval2412 at yahoo.fr
Sun Sep 13 03:35:09 PDT 2015


 bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 313037a7ed10e979a3af8ffac801dd6b6bdb7615
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Sep 13 09:42:01 2015 +0200

    cppcheck: Mismatching allocation and deallocation
    
    + Typo: excecptionTypeSizeArray->exceptionTypeSizeArray
    
    Cherry-picked from 81d62c5f48f3bf341c4c7bdaef5a5ce5941f3e62
    
    Change-Id: I6fac3bea1eba094e87717d20a08ec7cf6151e2df
    Reviewed-on: https://gerrit.libreoffice.org/18527
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
index f95a045..321a168 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
@@ -609,8 +609,8 @@ RaiseInfo::RaiseInfo(typelib_TypeDescription * pTD)throw ()
 
     // 2.Pass: Get the total needed memory for class ExceptionType
     // (with embedded type_info) and keep the sizes for each instance
-    // is stored in alloced int array
-    int *excecptionTypeSizeArray = new int[nLen];
+    // is stored in allocated int array
+    int *exceptionTypeSizeArray = new int[nLen];
 
     nLen = 0;
     for (pCompTD = (typelib_CompoundTypeDescription*)pTD;
@@ -625,14 +625,14 @@ RaiseInfo::RaiseInfo(typelib_TypeDescription * pTD)throw ()
             n++;
             typeInfoLen = n*4;
         }
-        excecptionTypeSizeArray[nLen++] = typeInfoLen + sizeof(ExceptionType);
+        exceptionTypeSizeArray[nLen++] = typeInfoLen + sizeof(ExceptionType);
     }
 
     // Total ExceptionType related mem
     int excTypeAddLen = 0;
     for (int i = 0; i < nLen; i++)
     {
-        excTypeAddLen += excecptionTypeSizeArray[i];
+        excTypeAddLen += exceptionTypeSizeArray[i];
     }
 
     // Allocate mem for code and all dynamic data in one chunk to guarantee
@@ -684,7 +684,7 @@ RaiseInfo::RaiseInfo(typelib_TypeDescription * pTD)throw ()
         // Next trampoline entry offset
         pCodeOffset += codeSnippetSize;
         // Next ExceptionType placement offset
-        etMemOffset += excecptionTypeSizeArray[nPos - 1];
+        etMemOffset += exceptionTypeSizeArray[nPos - 1];
 
         // Keep offset of addresses of ET for D-Tor call in ~RaiseInfo
         types[nPos++]
@@ -694,7 +694,7 @@ RaiseInfo::RaiseInfo(typelib_TypeDescription * pTD)throw ()
     assert(etMem + etMemOffset == pCode + totalSize);
 
     // remove array
-    delete excecptionTypeSizeArray;
+    delete[] exceptionTypeSizeArray;
 }
 
 RaiseInfo::~RaiseInfo() throw ()


More information about the Libreoffice-commits mailing list