Kaydet (Commit) 2298c1a6 authored tarafından Michael Stahl's avatar Michael Stahl

sal: PVS-Studio V611 memory was allocated using 'new T[]' operator

... but was released using the 'delete' operator

Change-Id: I67a4b9b8c60f7fddaeef4344ba472d331b3ca154
üst 61e723e4
...@@ -131,7 +131,7 @@ namespace osl { ...@@ -131,7 +131,7 @@ namespace osl {
pStrings[ nItems ] = NULL; pStrings[ nItems ] = NULL;
bool bRet = bool bRet =
osl_writeProfileIdent(profile, rSection.getStr(), rEntry.getStr(), nFirstId, pStrings, nValue ); osl_writeProfileIdent(profile, rSection.getStr(), rEntry.getStr(), nFirstId, pStrings, nValue );
delete pStrings; delete[] pStrings;
return bRet; return bRet;
} }
...@@ -162,7 +162,7 @@ namespace osl { ...@@ -162,7 +162,7 @@ namespace osl {
size_t nLen; size_t nLen;
for( n = 0; ( nLen = strlen( pBuf+n ) ); n += nLen+1 ) for( n = 0; ( nLen = strlen( pBuf+n ) ); n += nLen+1 )
aEntries.push_back( rtl::OString( pBuf+n ) ); aEntries.push_back( rtl::OString( pBuf+n ) );
delete pBuf; delete[] pBuf;
} }
return aEntries; return aEntries;
...@@ -184,7 +184,7 @@ namespace osl { ...@@ -184,7 +184,7 @@ namespace osl {
size_t nLen; size_t nLen;
for( n = 0; ( nLen = strlen( pBuf+n ) ); n += nLen+1 ) for( n = 0; ( nLen = strlen( pBuf+n ) ); n += nLen+1 )
aSections.push_back( rtl::OString( pBuf+n ) ); aSections.push_back( rtl::OString( pBuf+n ) );
delete pBuf; delete[] pBuf;
} }
return aSections; return aSections;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment