openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From truck...@apache.org
Subject svn commit: r1838312 - in /openoffice/trunk/main: sal/inc/osl/profile.hxx scripting/source/stringresource/stringresource.cxx
Date Sat, 18 Aug 2018 07:25:27 GMT
Author: truckman
Date: Sat Aug 18 07:25:26 2018
New Revision: 1838312

URL: http://svn.apache.org/viewvc?rev=1838312&view=rev
Log:
Arrays allocated with new [] should be freed using delete[].


Modified:
    openoffice/trunk/main/sal/inc/osl/profile.hxx
    openoffice/trunk/main/scripting/source/stringresource/stringresource.cxx

Modified: openoffice/trunk/main/sal/inc/osl/profile.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/inc/osl/profile.hxx?rev=1838312&r1=1838311&r2=1838312&view=diff
==============================================================================
--- openoffice/trunk/main/sal/inc/osl/profile.hxx (original)
+++ openoffice/trunk/main/sal/inc/osl/profile.hxx Sat Aug 18 07:25:26 2018
@@ -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;

Modified: openoffice/trunk/main/scripting/source/stringresource/stringresource.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/scripting/source/stringresource/stringresource.cxx?rev=1838312&r1=1838311&r2=1838312&view=diff
==============================================================================
--- openoffice/trunk/main/scripting/source/stringresource/stringresource.cxx (original)
+++ openoffice/trunk/main/scripting/source/stringresource/stringresource.cxx Sat Aug 18 07:25:26
2018
@@ -2300,7 +2300,7 @@ bool StringResourcePersistenceImpl::impl
 					}
 				}
 
-				delete pIdPtrs;
+				delete[] pIdPtrs;
 			}
 
 			bSuccess = true;



Mime
View raw message