diff options
author | Matthew J. Francis <mjay.francis@gmail.com> | 2014-09-20 12:14:41 +0800 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-09-22 05:15:53 +0000 |
commit | 764e3016b62665281539af4e990ca4ff0445c26c (patch) | |
tree | f5ec6b10fa76e3f622d26095981e5c1a92c2485f /basic | |
parent | 935e8fc98c033680029e4531747a2f680f50d5ca (diff) |
fdo#84086 Fix assorted use-after-free bugs
Change-Id: Iec004fffdb0afbe27bd69f379db90f6d904a8a65
Reviewed-on: https://gerrit.libreoffice.org/11553
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/comp/sbcomp.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx index 59b0fd7457e8..7e79bef3c337 100644 --- a/basic/source/comp/sbcomp.cxx +++ b/basic/source/comp/sbcomp.cxx @@ -414,7 +414,7 @@ void lcl_printTimeOutput( void ) if( pFunctionItem != NULL ) { OUString aCompleteFunctionName = pFunctionItem->m_aCompleteFunctionName; - const char* pName = OUStringToOString( aCompleteFunctionName, RTL_TEXTENCODING_ASCII_US ).getStr(); + OString aName = OUStringToOString( aCompleteFunctionName, RTL_TEXTENCODING_ASCII_US ); int nNameLen = aCompleteFunctionName.getLength(); double dFctTotalTime = pFunctionItem->m_dTotalTime; @@ -427,7 +427,7 @@ void lcl_printTimeOutput( void ) nSpaceCount = 2; } sprintf( TimeBuffer, "%s:%sCalled %d times\t%f ms (%f%%) / net %f (%f%%) ms", - pName, lcl_getSpaces( nSpaceCount ), pFunctionItem->m_nCallCount, + aName.getStr(), lcl_getSpaces( nSpaceCount ), pFunctionItem->m_nCallCount, dFctTotalTime*1000.0, dFctTotalTimePercent, dFctNetTime*1000.0, dFctNetTimePercent ); lcl_lineOut( TimeBuffer ); } @@ -566,9 +566,9 @@ void dbg_traceStep( SbModule* pModule, sal_uInt32 nPC, sal_Int32 nCallLvl ) ModuleTraceMap::iterator it = rModuleTraceMap.find( aModuleName ); if( it == rModuleTraceMap.end() ) { - const char* pModuleNameStr = OUStringToOString( OUString( aModuleName ), RTL_TEXTENCODING_ASCII_US ).getStr(); + OString aModuleNameStr = OUStringToOString( OUString( aModuleName ), RTL_TEXTENCODING_ASCII_US ); char Buffer[200]; - sprintf( Buffer, "TRACE ERROR: Unknown module \"%s\"", pModuleNameStr ); + sprintf( Buffer, "TRACE ERROR: Unknown module \"%s\"", aModuleNameStr.getStr() ); lcl_lineOut( Buffer ); return; } @@ -583,9 +583,9 @@ void dbg_traceStep( SbModule* pModule, sal_uInt32 nPC, sal_Int32 nCallLvl ) PCToTextDataMap::iterator itInner = pInnerMap->find( nPC ); if( itInner == pInnerMap->end() ) { - const char* pModuleNameStr = OUStringToOString( OUString( aModuleName ), RTL_TEXTENCODING_ASCII_US ).getStr(); + OString aModuleNameStr = OUStringToOString( OUString( aModuleName ), RTL_TEXTENCODING_ASCII_US ); char Buffer[200]; - sprintf( Buffer, "TRACE ERROR: No info for PC = %d in module \"%s\"", (int)nPC, pModuleNameStr ); + sprintf( Buffer, "TRACE ERROR: No info for PC = %d in module \"%s\"", (int)nPC, aModuleNameStr.getStr() ); lcl_lineOut( Buffer ); return; } @@ -925,9 +925,8 @@ void RTL_Impl_TraceCommand( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ) } char Buffer[500]; - const char* pValStr = OUStringToOString( OUString( aValStr ), RTL_TEXTENCODING_ASCII_US ).getStr(); - sprintf( Buffer, "### TRACE_PRINT: %s ###", pValStr ); + sprintf( Buffer, "### TRACE_PRINT: %s ###", OUStringToOString( OUString( aValStr ), RTL_TEXTENCODING_ASCII_US ).getStr() ); int nIndent = GnLastCallLvl * GnIndentPerCallLevel; lcl_lineOut( Buffer, lcl_getSpaces( nIndent ) ); |