path: root/scripting/source/provider
diff options
authorStephan Bergmann <>2019-10-16 22:53:34 +0200
committerStephan Bergmann <>2019-10-17 09:03:53 +0200
commitc8eaadb5d70f42723517bb028f363e37726be256 (patch)
tree6d91ba30db1dde2c0ad00f0bd453bed937d98660 /scripting/source/provider
parent7972ce0d6bc22a36d7fbaaa19bed11ec4cfe52d7 (diff)
Remaining loplugin:bufferadd
...that had been missing because the plugin didn't implement postRun, so it didn't report anything when run as part of the shared plugin. (But did report the expected warnings when run as a standalone plugin during CompilerTest_compilerplugins_clang.) Most fixes are straightforward. A noteworthy one is PreparedStatement::setBytes in connectivity/source/drivers/postgresql/pq_preparedstatement.cxx: The old preallocation of a 20 character OStringBuffer might have prevented buf.append( reinterpret_cast<char *>(escapedString), len -1 ); from potentially throwing std::bad_alloc, which would have caused escapedString to be leaked. Even though that 20-character preallocation was likely just random junk and not meant to address the potential leak, lets address it now. Change-Id: Ib506332d061684a22a74e5e39e591539fd2c4900 Reviewed-on: Tested-by: Jenkins Reviewed-by: Stephan Bergmann <>
Diffstat (limited to 'scripting/source/provider')
1 files changed, 1 insertions, 4 deletions
diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx
index 7a5475541179..9367ea4c4236 100644
--- a/scripting/source/provider/MasterScriptProvider.cxx
+++ b/scripting/source/provider/MasterScriptProvider.cxx
@@ -298,10 +298,7 @@ MasterScriptProvider::getScript( const OUString& scriptURI )
Reference< provider::XScriptProvider > xScriptProvider;
- OUStringBuffer buf( 80 );
- buf.append( "");
- buf.append( language );
- OUString serviceName = buf.makeStringAndClear();
+ OUString serviceName = "" + language;
if ( !providerCache() )
throw provider::ScriptFrameworkErrorException(