diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-09-07 16:09:50 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-09-07 22:04:50 +0200 |
commit | b18747fcee1ba8744e5cd63791dc9f3eb6848a56 (patch) | |
tree | 51d0216e5f58822e820861499605e145e563dff5 /vcl/win | |
parent | 694a6389e84d5b416cde6dde2d5eaa589a0a6493 (diff) |
Fix some std::unique_ptr array allocs
Found by reviewing the output of and the code around
git grep -n "unique_ptr.*new.*\[.*\]" | grep -v "\[\]"
The onlineupdater code needs a little bit more attention.
Change-Id: I8b70c7da7db60af52bfac12314a21602ede8bfc0
Reviewed-on: https://gerrit.libreoffice.org/60162
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/app/salinst.cxx | 2 | ||||
-rw-r--r-- | vcl/win/window/salframe.cxx | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx index af97c82f752e..0f422f3cfc72 100644 --- a/vcl/win/app/salinst.cxx +++ b/vcl/win/app/salinst.cxx @@ -1057,7 +1057,7 @@ OUString WinSalInstance::getOSVersion() dwCount = GetFileVersionInfoSizeW(szPath, nullptr); if (dwCount != 0) { - std::unique_ptr<char> ver(new char[dwCount]); + std::unique_ptr<char[]> ver(new char[dwCount]); if (GetFileVersionInfoW(szPath, 0, dwCount, ver.get()) != FALSE) { void* pBlock = nullptr; diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index 7b50f7f4cd09..ef6d7ff2827a 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -4987,12 +4987,12 @@ static bool ImplHandleIMECompositionInput( WinSalFrame* pFrame, if ( nTextLen > 0 ) { { - auto pTextBuf = std::unique_ptr<WCHAR>(new WCHAR[nTextLen]); + auto pTextBuf = std::unique_ptr<WCHAR[]>(new WCHAR[nTextLen]); ImmGetCompositionStringW( hIMC, GCS_COMPSTR, pTextBuf.get(), nTextLen*sizeof( WCHAR ) ); aEvt.maText = OUString( o3tl::toU(pTextBuf.get()), static_cast<sal_Int32>(nTextLen) ); } - std::unique_ptr<BYTE> pAttrBuf; + std::unique_ptr<BYTE[]> pAttrBuf; LONG nAttrLen = ImmGetCompositionStringW( hIMC, GCS_COMPATTR, nullptr, 0 ); if ( nAttrLen > 0 ) { |