summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-22 14:56:55 (GMT)
committerBrad King <brad.king@kitware.com>2019-08-26 13:43:45 (GMT)
commit3f4c4e7afe6075b18f99c67cf808e2300b3690c4 (patch)
treed35747155c39491ebc97f0d9f46bbb57ce3d37b4 /Source
parenta8ca5aea946e1154b4518ba28db3f4e695dbf165 (diff)
downloadCMake-3f4c4e7afe6075b18f99c67cf808e2300b3690c4.zip
CMake-3f4c4e7afe6075b18f99c67cf808e2300b3690c4.tar.gz
CMake-3f4c4e7afe6075b18f99c67cf808e2300b3690c4.tar.bz2
cmVSSetupHelper: Fix SmartBSTR copy operations
Fix the SmartBSTR copy constructor and copy assignment operator added by commit 18c8278b62 (VS: Add helper class to interact with Visual Studio Installer, 2016-12-14, v3.8.0-rc1~93^2~4) to use the string from the source of the copy. Issue: #19610
Diffstat (limited to 'Source')
-rw-r--r--Source/cmVSSetupHelper.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmVSSetupHelper.h b/Source/cmVSSetupHelper.h
index 1bda54a..9382c05 100644
--- a/Source/cmVSSetupHelper.h
+++ b/Source/cmVSSetupHelper.h
@@ -77,7 +77,8 @@ public:
SmartBSTR(const SmartBSTR& src)
{
if (src.str != NULL) {
- str = ::SysAllocStringByteLen((char*)str, ::SysStringByteLen(str));
+ str =
+ ::SysAllocStringByteLen((char*)src.str, ::SysStringByteLen(src.str));
} else {
str = ::SysAllocStringByteLen(NULL, 0);
}
@@ -87,7 +88,8 @@ public:
if (str != src.str) {
::SysFreeString(str);
if (src.str != NULL) {
- str = ::SysAllocStringByteLen((char*)str, ::SysStringByteLen(str));
+ str =
+ ::SysAllocStringByteLen((char*)src.str, ::SysStringByteLen(src.str));
} else {
str = ::SysAllocStringByteLen(NULL, 0);
}