diff options
author | Don Lewis <truckman@apache.org> | 2018-08-18 07:25:26 +0000 |
---|---|---|
committer | Don Lewis <truckman@apache.org> | 2018-08-18 07:25:26 +0000 |
commit | 3cc7c171ef01fd267ae29f0f70d473e79d99c356 (patch) | |
tree | a3e2bdc02967af67c48606dd316f8934c9fdf147 | |
parent | b4353325a7d41c97c31532b7e5ac3cebc8b3624e (diff) |
Arrays allocated with new [] should be freed using delete[].
Notes
Notes:
prefer: 3901964b6d1fb2117cb983a7eedf80da93ba5530
-rw-r--r-- | sal/inc/osl/profile.hxx | 8 | ||||
-rw-r--r-- | scripting/source/stringresource/stringresource.cxx | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sal/inc/osl/profile.hxx b/sal/inc/osl/profile.hxx index 25bafed6d520..26f2ef9ae6df 100644 --- a/sal/inc/osl/profile.hxx +++ b/sal/inc/osl/profile.hxx @@ -103,7 +103,7 @@ namespace osl { } pStrings[ nItems ] = NULL; sal_uInt32 nRet = osl_readProfileIdent( profile, rSection.getStr(), rEntry.getStr(), nFirstId, pStrings, nDefault); - delete pStrings; + delete[] pStrings; return nRet; } @@ -134,7 +134,7 @@ namespace osl { pStrings[ nItems ] = NULL; sal_Bool bRet = osl_writeProfileIdent( profile, rSection.getStr(), rEntry.getStr(), nFirstId, pStrings, nValue ); - delete pStrings; + delete[] pStrings; return bRet; } @@ -164,7 +164,7 @@ namespace osl { int nLen; for( n = 0; ( nLen = strlen( pBuf+n ) ); n += nLen+1 ) aEntries.push_back( rtl::OString( pBuf+n ) ); - delete pBuf; + delete[] pBuf; } return aEntries; @@ -187,7 +187,7 @@ namespace osl { int nLen; for( n = 0; ( nLen = strlen( pBuf+n ) ); n += nLen+1 ) aSections.push_back( rtl::OString( pBuf+n ) ); - delete pBuf; + delete[] pBuf; } return aSections; diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index a9d6b0ba329b..ee15035becf3 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -2300,7 +2300,7 @@ bool StringResourcePersistenceImpl::implWritePropertiesFile( LocaleItem* pLocale } } - delete pIdPtrs; + delete[] pIdPtrs; } bSuccess = true; |